Skip to content

Instantly share code, notes, and snippets.

@hackintoshrao
Created May 7, 2018 03:47
Show Gist options
  • Save hackintoshrao/8cec262f609d20a6aa950e9f5444a2f7 to your computer and use it in GitHub Desktop.
Save hackintoshrao/8cec262f609d20a6aa950e9f5444a2f7 to your computer and use it in GitHub Desktop.
Example for using math functions in tensorflow
import tensorflow as tf
x = tf.constant(10)
y = tf.constant(2)
z = tf.subtract(tf.divide(x,y),tf.cast(tf.constant(1), tf.float64))
with tf.Session() as sess:
output = sess.run(z)
print(output)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment