import tensorflow as tf print(tf.__version__)
2.0.0
x = tf.constant([[1.,2.,3.],[4.,5.,6.],[7,8,9]]) print(x)
tf.Tensor( [[1. 2. 3.] [4. 5. 6.] [7. 8. 9.]], shape=(3, 3), dtype=float32)
print(type(x)) print(x.dtype) print(x.shape)
<class 'tensorflow.python.framework.ops.EagerTensor'> <dtype: 'float32'> (3, 3)
y = tf.matmul(x,x) print(y)
tf.Tensor( [[ 30. 36. 42.] [ 66. 81. 96.] [102. 126. 150.]], shape=(3, 3), dtype=float32)