parameters: (self, inputs)
return_statement: return tf.map_fn(self._single_transform, [inputs[0], trf], dtype=tf.float32)
docstring: Parameters
              inputs: list with two entries
docstring_summary: Parameters
              inputs: list with two entries
docstring_tokens: Parameters inputs : list with two entries
function: def call(self, inputs):
          """
          Parameters
              inputs: list with two entries
          """
  
          # check shapes
          assert len(inputs) == 2, "inputs has to be len 2, found: %d" % len(inputs)
          vol = inputs[0]
          trf = inputs[1]
  
          # if not self.is_affine:
          #     if not all([trf.shape[1:-1][f] == vol.shape[1:-1][f] for f in range(self.ndims)]):
          #         raise Exception('Shift shape should match vol shape. '
          #                         'Got: ' + str(trf.shape[1:-1]) + ' and ' + str(vol.shape[1:-1]))
  
          # go from affine
          if self.is_affine:
              trf = tf.map_fn(lambda x: self._single_aff_to_shift(x, vol.shape[1:-1]), trf, dtype=tf.float32)
  
          # prepare location shift
          if self.indexing == 'xy':  # shift the first two dimensions
              trf_split = tf.split(trf, trf.shape[-1], axis=-1)
              trf_lst = [trf_split[1], trf_split[0], *trf_split[2:]]
              trf = tf.concat(trf_lst, -1)
  
          # map transform across batch
          return tf.map_fn(self._single_transform, [inputs[0], trf], dtype=tf.float32)
function_tokens: def call ( self , inputs ) : # check shapes assert len ( inputs ) == 2 , "inputs has to be len 2, found: %d" % len ( inputs ) vol = inputs [ 0 ] trf = inputs [ 1 ] # if not self.is_affine: #     if not all([trf.shape[1:-1][f] == vol.shape[1:-1][f] for f in range(self.ndims)]): #         raise Exception('Shift shape should match vol shape. ' #                         'Got: ' + str(trf.shape[1:-1]) + ' and ' + str(vol.shape[1:-1])) # go from affine if self . is_affine : trf = tf . map_fn ( lambda x : self . _single_aff_to_shift ( x , vol . shape [ 1 : - 1 ] ) , trf , dtype = tf . float32 ) # prepare location shift if self . indexing == 'xy' : # shift the first two dimensions trf_split = tf . split ( trf , trf . shape [ - 1 ] , axis = - 1 ) trf_lst = [ trf_split [ 1 ] , trf_split [ 0 ] , * trf_split [ 2 : ] ] trf = tf . concat ( trf_lst , - 1 ) # map transform across batch return tf . map_fn ( self . _single_transform , [ inputs [ 0 ] , trf ] , dtype = tf . float32 )