1.) Multiplication of two number using a tensorflow library in python3.





import tensorflow as tf
a=tf.constant(3.0)
b=tf.constant(2.0)
c=a*b
sess=tf.Session()
print(sess.run(c))





Output


Here in the example, constant tensors were used so no need to provide value at runtime and directly you can execute a program with a session.

Comments