Skip to content

Instantly share code, notes, and snippets.

@Ouwen
Last active July 26, 2018 04:26
Show Gist options
  • Save Ouwen/66326b796311f0cca3c60067b9237124 to your computer and use it in GitHub Desktop.
Save Ouwen/66326b796311f0cca3c60067b9237124 to your computer and use it in GitHub Desktop.
import tensorflow as tf
g1 = tf.Graph()
with g1.as_default():
my_input = tf.constant([-1,0,1], dtype=tf.float16, name="input")
# Add a print operation in between our "input" operation and "A" operation
my_printed_input = tf.Print(my_input, [], message="Running the graph.", name="print")
a = tf.square(my_printed_input, name="A")
b = tf.cos(a, name="B")
c = tf.sin(a, name="C")
d = tf.add(b, c, name="D")
e = tf.floor(b, name="E")
f = tf.sqrt(d, name="F")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment