Skip to content

Instantly share code, notes, and snippets.

@krunal3kapadiya
Created December 9, 2017 12:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save krunal3kapadiya/4c066dd86f5ec5d35deed8c698bf3d80 to your computer and use it in GitHub Desktop.
Save krunal3kapadiya/4c066dd86f5ec5d35deed8c698bf3d80 to your computer and use it in GitHub Desktop.
from __future__ import print_function
import tensorflow as tf
# Basic constant operations
a = tf.constant(2)
b = tf.constant(4)
# Launch the default graph.
with tf.Session() as sess:
print("a=2, b=4")
print("Addition with constants: %i" % sess.run(a+b))
print("Multiplication with constants: %i" % sess.run(a*b))
print("Substraction with constants: %i" % sess.run(b-a))
print("Division with constants: %i" % sess.run(b/a))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment