Forked from camrongodbout/tensor_simple_operation.py
Created
August 31, 2016 17:27
-
-
Save Libardo1/2d927b3619698044b23876bb77c1f2a4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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