0
变量Test
在这两种情况下是共享的吗?整个范围路径是否需要匹配TensorFlow中的变量重用?
with tf.name_scope("ns1"):
with tf.variable_scope("vs1"):
var = tf.get_variable("Test", [1,2,3])
with tf.name_scope("ns2"):
with tf.variable_scope("vs1", reuse=True):
var = tf.get_variable("Test", [1,2,3])
和
with tf.name_scope("ns1"):
with tf.variable_scope("vs1"):
var = tf.get_variable("Test", [1,2,3])
with tf.variable_scope("vs1", reuse=True):
var = tf.get_variable("Test", [1,2,3])
谢谢!仅在变量的第一个实例化后使用'reuse = True'吗? –