Skip to content

Instantly share code, notes, and snippets.

@irdanish11
Last active June 22, 2020 02:36
Show Gist options
  • Select an option

  • Save irdanish11/ea95b7e0bf3f2cf20009317bd40bfe81 to your computer and use it in GitHub Desktop.

Select an option

Save irdanish11/ea95b7e0bf3f2cf20009317bd40bfe81 to your computer and use it in GitHub Desktop.
tf.compat.v1.disable_eager_execution() # need to disable eager in TF2.x
x = tf.compat.v1.placeholder(tf.float32, shape=(1024, 1024))
y = tf.matmul(x, x)
with tf.compat.v1.Session() as sess:
rand_array = np.random.rand(1024, 1024)
print(sess.run(y, feed_dict={x: rand_array})) # Will succeed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment