In [19]:
import tensorflow as tf
with tf.name_scope("hw"):
    with tf.name_scope("square_a"):
                a=4
                d=tf.pow(a,4)
    with tf.name_scope("square_b"):
                b=4
                e=tf.pow(b,4)
    with tf.name_scope("square_b"):
                c=4
                f=tf.pow(b,4)
    with tf.name_scope("multiply"):
                m=tf.multiply(a,b)
    with tf.name_scope("4ab"):
                n=tf.multiply(m,4)
    
    with tf.name_scope("multiply"):
                s=tf.multiply(b,c)
    with tf.name_scope("4bc"):
                t=tf.multiply(s,4)
            
    with tf.name_scope("multiply"):
                k=tf.multiply(a,c)
    with tf.name_scope("4ac"):
                t=tf.multiply(k,4)
            
    with tf.name_scope("result"):
        with tf.name_scope("add_1"):
            x=tf.add(d,e)
            with tf.name_scope("add_2"):
                    y=tf.add(x,f)
                    with tf.name_scope("add_3"):
                            z=tf.add(y,n)
                            with tf.name_scope("sub_1"):
                                i=tf.subtract(z,t)
                                with tf.name_scope("sub_2"):
                                    q=tf.subtract(f,t)
                
with tf.Session() as sess:
    writer = tf.summary.FileWriter("/tmp/tboard/output2",sess.graph)
    print(sess.run(q))
    writer.close()


192

In [ ]: