如何在tensorflow中从Python获取运算符引用?

时间:2018-01-11 04:06:52

标签: tensorflow

我可以在tensorboard中看到附加到运算符的引用边但是如何以编程方式将它们拉出相关的张量/运算符?

示例:

以下代码示例创建了生成的tensorboard可视化:

代码:

with tf.name_scope('blah') as scope:
  a = tf.constant(5.3, name='alpha')
  b = tf.Variable(tf.zeros([1]), name='b')

add = a+b
ass = tf.assign(b,add,name="ass")

可视化:

A visualisation of the code with the ass operation open

更深入的可视化,展开b

A visualisation of the code with the ass operation expanded

但是,如果我检查代码中的可变assass.op,我无法找到返回分配给b的变量的引用。肯定会有这样的事情,但我根本找不到它。

1 个答案:

答案 0 :(得分:0)

我刚发现它。

ass.op.inputs[0]

是dtype float32_ref的张量。

缺少_ref部分。

相关问题