def simple_multi_optimizer(num_dims=2):
 def get_coordinate(i):
  return tf.get_variable('x_{}'.format(i), shape=[], dtype=tf.float32, initializer=tf.ones_initializer())
 def build():
  coordinates = [get_coordinate(i) for i in xrange(num_dims)]
  x = tf.concat(0, [tf.expand_dims(c, 0) for c in coordinates])
  return tf.reduce_sum(tf.square(x, name='x_squared'))
 return build

def simple_multi_optimizer ( num_dims = 2 ) : def get_coordinate ( i ) : return tf . get_variable ( 'x_{}' . format ( i ) , shape = [ ] , dtype = tf . float32 , initializer = tf . ones_initializer ( ) ) def build ( ) : coordinates = [ get_coordinate ( i ) for i in xrange ( num_dims ) ] x = tf . concat ( 0 , [ tf . expand_dims ( c , 0 ) for c in coordinates ] ) return tf . reduce_sum ( tf . square ( x , name = 'x_squared' ) ) return build
multidimensional simple problem .