I have been using the introductory example of matrix multiplication in TensorFlow.
matrix1 = tf.constant([[3., 3.]])
matrix2 = tf.constant([[2.],[2.]])
produ
Basically, in tensorflow when you create a tensor of any sort they are created and stored inside which can be accessed only when you run a tensorflow session. Say you have created a constant tensor
c = tf.constant([[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]])
Without running a session, you can get
- op: An Operation. Operation that computes this tensor.
- value_index: An int. Index of the operation's endpoint that produces this tensor.
- dtype: A DType. Type of elements stored in this tensor.
To get the values you can run a session with the tensor you require as:
with tf.Session() as sess:
print(sess.run(c))
sess.close()
The output will be something like this:
array([[1., 2., 3.], [4., 5., 6.]], dtype=float32)