官术网_书友最值得收藏!

Finding the mean across rows 

Find the mean across rows (that is, reduce columns) with this:

tf.reduce_mean(input_tensor=numbers, axis=1) # [ (4. + 5. )/2 , (7. + 3. )/2] = [4.5, 5]

The output will be as follows:

<tf.Tensor: id=64, shape=(2,), dtype=float32, numpy=array([4.5, 5. ], dtype=float32)>

When keepdims is True, the reduced axis is retained with a length of 1:

tf.reduce_mean(input_tensor=numbers, axis=1, keepdims=True)

The output is as follows:

([[4.5], [5]])      (2 rows, 1 column)
主站蜘蛛池模板: 余庆县| 吴川市| 应城市| 永康市| 和平县| 女性| 芜湖县| 米泉市| 木里| 孟州市| 漳平市| 阿克陶县| 手游| 舟山市| 平邑县| 贡山| 余庆县| 左云县| 平和县| 夏邑县| 沙坪坝区| 克东县| 咸丰县| 祥云县| 泰宁县| 揭东县| 原阳县| 揭东县| 尼玛县| 宁波市| 双柏县| 昌图县| 湘潭市| 台南县| 阜宁县| 奎屯市| 沂南县| 卓资县| 富阳市| 双鸭山市| 岳阳市|