書名: TensorFlow 2.0 Quick Start Guide作者名: Tony Holdroyd本章字數: 39字更新時間: 2021-06-24 16:02:05
Finding the mean across all axes
Find the mean across all axes (that is, use the default axis = None) with this:
tf.reduce_mean(input_tensor=numbers)
#( 4. + 5. + 7. + 3.)/4 = 4.75
The output will be as follows:
<tf.Tensor: id=272, shape=(), dtype=float32, numpy=4.75>
推薦閱讀