In [1]:
import tensorflow as tf
with tf.name_scope("op"):
with tf.name_scope('x'):
a = 3
b = tf.pow(a, 2)
with tf.name_scope("y"):
c = 2
d = tf.pow(c, 2)
with tf.name_scope("x_y"):
g = tf.add(b, d)
with tf.name_scope("2xy"):
e = tf.multiply(tf.multiply(2,a),c)
with tf.name_scope("x_y_2xy"):
h = tf.subtract(g, e)
with tf.Session() as sess:
writer = tf.summary.FileWriter("/tmp/tboard/op11", sess.graph)
print(sess.run(h))
writer.close()
In [ ]: