書名: TensorFlow 2.0 Quick Start Guide作者名: Tony Holdroyd本章字數: 34字更新時間: 2021-06-24 16:02:04
Specifying element-wise primitive tensor operations
Element-wise primitive tensor operations are specified using, as you would expect, the overloaded operators +, -, *, and /, as here:
t2*t2
The output will be as follows:
<tf.Tensor: id=555332, shape=(2, 2, 3), dtype=float32, numpy= array([[[ 0., 1., 4.], [ 9., 16., 25.]], [[ 36., 49., 64.], [ 81., 100., 121.]]], dtype=float32)>