Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import tensorflow as tf
- a = tf.constant(3.5)
- b = tf.constant(4.5)
- c = a * b
- # this is what you are doing
- print(c)
- # out: Tensor("mul_3:0", shape=(), dtype=float32)
- # this is what you want
- with tf.Session() as sess:
- result = c.eval()
- # Or use sess.run:
- # result = sess.run(c)
- print(result)
- # out: 15.75
- print(type(result))
- # out: <class 'numpy.float32'>
Add Comment
Please, Sign In to add comment