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" )
我们可以使用tf.get_variable
的属性name
在任何地方选择tensorflow中的变量。例如,在图像中,我们可以使用tf.get_variable("a")
来获取图g
中的变量。我们如何使用相同或相似的方法来获得常数"b"
目前没有回答
相关问题 更多 >
编程相关推荐