def flatten_reshape(variable, name=''):
 dim = 1
 for d in variable.get_shape()[1:].as_list():
  dim *= d
 return tf.reshape(variable, shape=[(-1), dim], name=name)

def flatten_reshape ( variable , name = '' ) : dim = 1 for d in variable . get_shape ( ) [ 1 : ] . as_list ( ) : dim *= d return tf . reshape ( variable , shape = [ ( - 1 ) , dim ] , name = name )
reshapes high-dimension input to a vector .