【发布时间】:2018-07-16 23:32:22
【问题描述】:
例如我有这样的代码:
def test():
v = tf.get_variable('test') # => foo/test
with tf.variable_scope('foo'):
test()
现在我想在 'foo' 范围之外创建一个变量:
def test():
with tf.variable_scope('bar'):
v = tf.get_variable('test') # foo/bar/test
但它被放置为“foo/bar/test”。我应该在 test() 正文中做什么以将其放置为没有“foo”根的“bar/test”?
【问题讨论】:
标签: python variables tensorflow scope