Guest User

Untitled

a guest
Jan 20th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. import tensorflow as tf
  2.  
  3. print("Pythonic:")
  4. print(8 + 5)
  5. print(8 - 5)
  6. print(8 * 5)
  7. print(8 / 5)
  8. print(8**5)
  9. print(8 % 5)
  10. print(8 // 5)
  11.  
  12. x = tf.constant(8)
  13. y = tf.constant(5)
  14. tf_add = tf.add(x, y)
  15. tf_subtract = tf.subtract(x, y)
  16. tf_multiply = tf.multiply(x, y)
  17. tf_divide = tf.divide(x, y)
  18. tf_pow = tf.pow(x, y)
  19. tf_mod = tf.mod(x, y)
  20. tf_quotient = tf.div(x, y)
  21. print("TensorFlow:")
  22. with tf.Session() as sess:
  23. print(sess.run(tf_add))
  24. print(sess.run(tf_subtract))
  25. print(sess.run(tf_multiply))
  26. print(sess.run(tf_divide))
  27. print(sess.run(tf_pow))
  28. print(sess.run(tf_mod))
  29. print(sess.run(tf_quotient))
Add Comment
Please, Sign In to add comment