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
  • 2,909
  • 2
  • 32
  • 41

0 Answers0