Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save Libardo1/2d927b3619698044b23876bb77c1f2a4 to your computer and use it in GitHub Desktop.

Select an option

Save Libardo1/2d927b3619698044b23876bb77c1f2a4 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()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment