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'嗎? –