Skip to content

Instantly share code, notes, and snippets.

@nithyadurai87
Last active December 12, 2019 14:54
Show Gist options
  • Select an option

  • Save nithyadurai87/495e2484a602abc85d3e53ed7ace7407 to your computer and use it in GitHub Desktop.

Select an option

Save nithyadurai87/495e2484a602abc85d3e53ed7ace7407 to your computer and use it in GitHub Desktop.
import tensorflow as tf
import numpy as np
x = tf.placeholder(tf.float32,name="x")
y = tf.placeholder(tf.float32,[1],name="y")
z = tf.constant(2.0)
y = x * z
print (x)
with tf.Session() as s:
print (s.run(y,feed_dict={x:[100]}))
print (s.run(y,{x:[200]}))
print (s.run(y,{x: np.random.rand(1, 10)}))
print (s.run(tf.pow(x, 2),{x:[300]}))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment