1
with tf.variable_scope('aa') as sa:
with tf.variable_scope('bb'):
x = tf.get_variable(
'biases', (2,),
initializer=tf.constant_initializer()
)
y1 = tf.identity(x, name='bb')
with tf.variable_scope(sa):
with tf.variable_scope('cc'):
x = tf.get_variable(
'biases', (2,),
initializer=tf.constant_initializer()
)
y2 = tf.identity(x, name='cc')
我輸入了兩次tf.variable_scope('aa')
,並生成了兩個張量y1
,y2
。如何強制tf.variable_scope重用name_scope?
但是,y2.name == 'aa_1/cc/cc:0'
。 (y1.name == 'aa/bb/bb:0'
)
是否可以改爲y2.name == 'aa/cc/cc:0'
?