In [1]:
import tensorflow as tf
tf.reset_default_graph()
x=int(input())
y=int(input())
with tf.name_scope("Split"):
    with tf.name_scope("a2"):
        a = tf.multiply(x,x)
    with tf.name_scope("b2"):
        b = tf.multiply(y,y)
    with tf.name_scope("2ab"):
        c = tf.multiply(x,y)
        k = 2
        d = tf.multiply(k,c)

with tf.name_scope("final"):
    e = tf.add(a,b)
    f = tf.subtract(e,d)


with tf.Session() as sess:
    writer = tf.summary.FileWriter("/tmp/tboard/output_2", sess.graph)
    print(sess.run(f))
    writer.close()


5
6
1

In [ ]:


In [ ]:


In [ ]: