t=tf.constant([[1.,2.,3.],[4.,5.,6.]])
print(t)
print(t[:,1:])
print(t[...,1])
'''
tf.Tensor(
[[1. 2. 3.]
[4. 5. 6.]], shape=(2, 3), dtype=float32)
tf.Tensor(
[[2. 3.]
[5. 6.]], shape=(2, 2), dtype=float32)
tf.Tensor([2. 5.], shape=(2,), dtype=float32)
'''
print(t+10)
print(tf.square(t))
print(t@tf.transpose(t))
'''
tf.Tensor(
[[11. 12. 13.]
[14. 15. 16.]], shape=(2, 3), dtype=float32)
tf.Tensor(
[[ 1. 4. 9.]
[16. 25. 36.]], shape=(2, 3), dtype=float32)
tf.Tensor(
[[14. 32.]
[32. 77.]], shape=(2, 2), dtype=float32)
'''
print(t.numpy())
print(np.square(t))
np_t=np.array([[1.,2.,3.],[4.,5.,6.]])
print(tf.constant(np_t))
'''
[[1. 2. 3.]
[4. 5. 6.]]
[[ 1. 4. 9.]
[16. 25. 36.]]
tf.Tensor(
[[1. 2. 3.]
[4. 5. 6.]], shape=(2, 3), dtype=float64)
'''