Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # GOOD CODE
- import tensorflow as tf
- # Build a graph.
- a = tf.constant(5.0)
- b = tf.constant(6.0)
- c = a * b
- # Launch the graph in a session.
- sess = tf.compat.v1.Session()
- # Evaluate the tensor `c`.
- print(sess.run(c))
- # BAD CODE
- import tensorflow as tf
- # Build a graph.
- a = tf.constant(5.0)
- b = tf.constant(6.0)
- c = a * b
- # Launch the graph in a session.
- sess = tf.compat.v1.Session()
- # Evaluate the tensor `c`.
- sess.run(c)
- print(c)
- Tensor("mul:0", shape=(), dtype=float32)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement