In [11]:
import tensorflow as tf
a = tf.multiply(2, 2,)
b = tf.multiply(3, 3,)
c = tf.multiply(4, 4,)
d = tf.multiply(2,2,)
e = tf.multiply(d,3,)
f = tf.multiply(2,3,)
g = tf.multiply(f,4,)
h = tf.multiply(2,2,)
i = tf.multiply(h,4,)
j = tf.add(a,b,)
k = tf.add(j,c,)
l = tf.subtract(e,k,)
m = tf.subtract(l,g,)
n = tf.subtract(m,i,)
with tf.Session() as sess:
writer = tf.summary.FileWriter("/tmp/tboard/output_h2", sess.graph)
print(sess.run(n))
writer.close()
In [9]:
import tensorflow as tf
a = tf.multiply(4,4,)
b = tf.multiply(3, 3,)
c = tf.add(16, 9,)
d = tf.multiply(4, a,)
e = tf.multiply(d, b,)
b = tf.subtract(b, e,)
with tf.Session() as sess:
writer = tf.summary.FileWriter("/tmp/tboard/output_h1", sess.graph)
print(sess.run(b))
writer.close()
In [2]:
import tensorflow as tf
with tf.name_scope("Scope"):
with tf.name_scope("Sqr_a"):
a=2
d=tf.pow(a,2)
with tf.name_scope("Sqr_b"):
b=4
e=tf.pow(b,4)
with tf.name_scope("Sqr_c"):
c=4
f=tf.pow(c,4)
with tf.name_scope("multiply"):
g=tf.multiply(a,b)
with tf.name_scope("2ab"):
h=tf.multiply(g,2)
with tf.name_scope("multiply"):
i=tf.multiply(b,c)
with tf.name_scope("2bc"):
j=tf.multiply(i,2)
with tf.name_scope("multiply"):
k=tf.multiply(a,c)
with tf.name_scope("2ac"):
l=tf.multiply(k,2)
with tf.name_scope("solution"):
with tf.name_scope("add1"):
m=tf.add(d,e)
with tf.name_scope("add2"):
n=tf.add(m,f)
with tf.name_scope("add3"):
o=tf.add(n,h)
with tf.name_scope("sub1"):
p=tf.subtract(o,j)
with tf.name_scope("sub2"):
q=tf.subtract(p,l)
with tf.Session() as sess:
writer=tf.summary.FileWriter("/tmp/tboard/output2", sess.graph)
print(sess.run(q))
writer.close()
In [5]:
import tensorflow as tf
with tf.name_scope("MyOperationGroup"):
with tf.name_scope("Scope_A"):
a = tf.add(1, 2, name="Add_these_numbers")
b = tf.multiply(a, 3)
with tf.name_scope("Scope_B"):
c = tf.add(4, 5, name="And_These_ones")
d = tf.multiply(c, 6, name="Multiply_these_numbers")
with tf.name_scope("Scope_C"):
e = tf.multiply(4, 5, name="B_add")
f = tf.div(c, 6, name="B_mul")
g = tf.add(b, d)
h = tf.multiply(g, f)
with tf.Session() as sess:
writer = tf.summary.FileWriter("/tmp/tboard/output3", sess.graph)
print(sess.run(h))
writer.close()
In [ ]: