Skip to content

Instantly share code, notes, and snippets.

@unixnme
Last active September 17, 2017 13:29
import tensorflow as tf
import numpy as np
# phase 1: define computation graph f
pi = tf.constant(np.pi)
one = tf.constant(1.)
# both one and pi must be of same datatype
f = tf.add(pi,one)
# phase 2: execute computation graph f
with tf.Session() as sess:
print sess.run(f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment