What is the difference between `variable.name` and` variable.op.name`?

Assuming x is Variable , I saw using op.name as tf.scalar_summary(x.op.name, x) in the tutorial. I am wondering if I can replace x.op.name with x.name in general.

What is the difference between the two? Are they interchangeable?

 with tf.name_scope('ab'): a = tf.Variable(tf.constant(1), name="v1") a.name u'ab_1/v1:0' a.op.name u'ab_1/v1' 
+5
source share
1 answer

Currently, the Variable.name property displays the name of the variable Tensor in which this variable is stored (mainly because a Variable can be used wherever Tensor is expected). The tensor names are generated from the name of the operation that produces them (a Variable op in this case) and the output index to which this tensor corresponds.

You can freely use tf.scalar_summary(x.name, x) instead of tf.scalar_summary(x.op.name, x) , but the resulting visualizations will contain the excess ":<N>" in the tags.

+9
source

Source: https://habr.com/ru/post/1240369/


All Articles