Skip to content

Instantly share code, notes, and snippets.

@BinRoot
Created November 3, 2016 14:40
Show Gist options
  • Save BinRoot/88555efe1b67ad59b3cd44c464e58707 to your computer and use it in GitHub Desktop.
Save BinRoot/88555efe1b67ad59b3cd44c464e58707 to your computer and use it in GitHub Desktop.
import tensorflow as tf
# Define a 2x1 matrix
matrix1 = tf.constant([[1., 2.]])
# Define a 1x2 matrix
matrix2 = tf.constant([[1],
[2]])
# Define a rank 3 tensor
myTensor = tf.constant([ [[1,2],
[3,4],
[5,6]],
[[7,8],
[9,10],
[11,12]] ])
# Try printing the tensors
print(matrix1)
print(matrix2)
print(myTensor)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment