一,命名空间函数
tf.variable_scope
tf.name_scope
先以下面的代码说明两者的区别
# 命名空间管理函数
'''
说明tf.variable_scope和tf.name_scope的区别
'''
def manage_namespace():
with tf.variable_scope("foo"):
# 在命名空间foo下获取变量"bar",于是得到的变量名称为"foo/bar"。
a = tf.get_variable("bar",[1]) #获取变量名称为“bar”的变量
print a.name #输出:foo/bar:0
with tf.variable