name_scope

来源:互联网 发布:电气火灾监控软件 编辑:程序博客网 时间:2024/06/08 21:17
import tensorflow as tf#name_scope matters op_name and Variable(), not get_variable()with tf.variable_scope("foo"):    with tf.name_scope("bar"):        v = tf.get_variable("v", [1])        b = tf.Variable(tf.zeros([1]), name='b')        x = 1.0 + vassert v.name == "foo/v:0"assert b.name == "foo/bar/b:0"assert x.op.name == "foo/bar/add"(tensorflow) root1@root:~/tensorflow$ python name_scope.py(tensorflow) root1@root:~/tensorflow$

原创粉丝点击