Manipulating Tensors
In [1]:
import tensorflow as tfIn [3]:
initMatrix = [
[10,7],
[3,4]
]
t = tf.constant(initMatrix)
tOut [3]:
Add To A Tensor
In [6]:
t2 = t + 10
t2Out [6]:
In [7]:
tOut [7]:
In [9]:
# multiply
t3 = t * 2
t3Out [9]:
In [10]:
t4 = t - 2
t4Out [10]:
In [12]:
t5 = tf.multiply(t, 3)
t5Out [12]: