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

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)
主站蜘蛛池模板: 千阳县| 剑河县| 望江县| 弥勒县| 常宁市| 宁河县| 永善县| 黑龙江省| 天峻县| 临澧县| 曲周县| 邵武市| 施秉县| 花莲县| 鞍山市| 龙海市| 新平| 东宁县| 沙洋县| 新津县| 湾仔区| 天津市| 永济市| 鞍山市| 承德市| 观塘区| 久治县| 宣武区| 洮南市| 玛多县| 南木林县| 安达市| 岱山县| 孝义市| 开远市| 陆丰市| 厦门市| 邮箱| 荔浦县| 长岛县| 鄂温|