0
with g1.as_default() :
    with tf.variable_scope("testa") :
        tf.get_variable(name = "a", shape = [1], dtype = tf.float32, initializer = tf.ones_initializer )
        tf.constant( value = [1], dtype = tf.float32, name = "b" )

we can use the attribute name of tf.get_variable to select the variable in the tensorflow at any places. for example, in the image, we can use tf.get_variable("a") to get variable in the graph g. How can we use the same or similar method to get the constant "b"?

Milo Lu
  • 3,176
  • 3
  • 35
  • 46

0 Answers0