Skip to content

Instantly share code, notes, and snippets.

@scmmishra
Last active January 17, 2018 17:16
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 scmmishra/df5fdb9eec8a7d598546163b41bd4420 to your computer and use it in GitHub Desktop.
Save scmmishra/df5fdb9eec8a7d598546163b41bd4420 to your computer and use it in GitHub Desktop.
Tensorflow Guide
import tensorflow as tf
a = tf.constant(5, name="input_a")
b = tf.constant(3, name="input_b")
c = tf.add(a,b, name="add_c")
d = tf.multiply(a,b, name="multiply_d")
e = tf.add(c,d, name="add_e")
sess = tf.Session()
output = sess.run(e)
# Uncomment the preeceing code to get a sneak peak at tensorboard
# writer = tf.summary.FileWriter('./my_graph', sess.graph)
# writer.close()
# sess.close()
# Now before you run the code go to your terminal and type in the following command
# making sure that your present working directory is the same as where you ran your Python code
# Command: tensorboard --logdir="my_graph"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment