Skip to content

Instantly share code, notes, and snippets.

@camrongodbout
Last active August 31, 2016 17:27
Show Gist options
  • Select an option

  • Save camrongodbout/9b2c4bec649c768401b09bbc07467067 to your computer and use it in GitHub Desktop.

Select an option

Save camrongodbout/9b2c4bec649c768401b09bbc07467067 to your computer and use it in GitHub Desktop.
import tensorflow as tf
# create a constant 2X2 matrix
tensor_1 = tf.constant([[1., 2.], [3.,4]])
tensor_2 = tf.constant([[5.,6.],[7.,8.]])
# create a matrix multiplication operation
output_tensor = tf.matmul(tensor_1, tensor_2)
# have to run the graph using a session
sess = tf.Session()
result = sess.run(output_tensor)
print(result)
sess.close()
@camrongodbout
Copy link
Author

@ktkirk Thank you. Updated with fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment