(self, host_calls)
Records the host_call structure.
Records the host_call structure.
Records the host_call structure .
def record(self, host_calls):
    """Records the host_call structure."""

    for name, host_call in host_calls.items():
      host_fn, tensor_list_or_dict = host_call
      self._names.append(name)
      self._host_fns[name] = host_fn

      if isinstance(tensor_list_or_dict, dict):
        for (key, tensor) in six.iteritems(tensor_list_or_dict):
          self._tensor_keys[name].append(key)
          self._tensors[name].append(tensor)
          self._tensor_dtypes[name].append(tensor.dtype)
          self._tensor_shapes[name].append(tensor.shape)
      else:
        # List or tuple.
        self._tensor_keys[name] = None
        for tensor in tensor_list_or_dict:
          self._tensors[name].append(tensor)
          self._tensor_dtypes[name].append(tensor.dtype)
          self._tensor_shapes[name].append(tensor.shape)
def record ( self , host_calls ) : for name , host_call in host_calls . items ( ) : host_fn , tensor_list_or_dict = host_call self . _names . append ( name ) self . _host_fns [ name ] = host_fn if isinstance ( tensor_list_or_dict , dict ) : for ( key , tensor ) in six . iteritems ( tensor_list_or_dict ) : self . _tensor_keys [ name ] . append ( key ) self . _tensors [ name ] . append ( tensor ) self . _tensor_dtypes [ name ] . append ( tensor . dtype ) self . _tensor_shapes [ name ] . append ( tensor . shape ) else : # List or tuple. self . _tensor_keys [ name ] = None for tensor in tensor_list_or_dict : self . _tensors [ name ] . append ( tensor ) self . _tensor_dtypes [ name ] . append ( tensor . dtype ) self . _tensor_shapes [ name ] . append ( tensor . shape )