def reshape(incoming, new_shape, name='Reshape'):
 with tf.name_scope(name) as scope:
  inference = incoming
  if isinstance(inference, list):
   inference = tf.concat(inference, 0)
   inference = tf.cast(inference, tf.float32)
  inference = tf.reshape(inference, shape=new_shape)
 inference.scope = scope
 tf.add_to_collection(((tf.GraphKeys.LAYER_TENSOR + '/') + name), inference)
 return inference

def reshape ( incoming , new_shape , name = 'Reshape' ) : with tf . name_scope ( name ) as scope : inference = incoming if isinstance ( inference , list ) : inference = tf . concat ( inference , 0 ) inference = tf . cast ( inference , tf . float32 ) inference = tf . reshape ( inference , shape = new_shape ) inference . scope = scope tf . add_to_collection ( ( ( tf . GraphKeys . LAYER_TENSOR + '/' ) + name ) , inference ) return inference
returns an array with new shape and same elements .