def batch_transformer(U, thetas, out_size, name='BatchSpatialTransformer'):
 with tf.variable_scope(name):
  (num_batch, num_transforms) = map(int, thetas.get_shape().as_list()[:2])
  indices = [([i] * num_transforms) for i in xrange(num_batch)]
  input_repeated = tf.gather(U, tf.reshape(indices, [(-1)]))
  return transformer(input_repeated, thetas, out_size)

def batch_transformer ( U , thetas , out_size , name = 'BatchSpatialTransformer' ) : with tf . variable_scope ( name ) : ( num_batch , num_transforms ) = map ( int , thetas . get_shape ( ) . as_list ( ) [ : 2 ] ) indices = [ ( [ i ] * num_transforms ) for i in xrange ( num_batch ) ] input_repeated = tf . gather ( U , tf . reshape ( indices , [ ( - 1 ) ] ) ) return transformer ( input_repeated , thetas , out_size )
batch spatial transformer layer parameters u : float tensor of inputs [num_batch .