Created
June 10, 2018 04:41
-
-
Save amobiny/a4c8b0ce1921be026b79ff2c983cff48 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tensorflow as tf | |
tf.reset_default_graph() # To clear the defined variables and operations of the previous cell | |
# create graph | |
a = tf.constant(2) | |
b = tf.constant(3) | |
c = tf.add(a, b) | |
# creating the writer out of the session | |
# writer = tf.summary.FileWriter('./graphs', tf.get_default_graph()) | |
# launch the graph in a session | |
with tf.Session() as sess: | |
# or creating the writer inside the session | |
writer = tf.summary.FileWriter('./graphs', sess.graph) | |
print(sess.run(c)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment