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

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)
主站蜘蛛池模板: 泸定县| 浙江省| 商河县| 临城县| 广昌县| 西华县| 孝感市| 湘潭市| 鹰潭市| 连江县| 五大连池市| 沂南县| 遵义县| 腾冲县| 苍溪县| 靖安县| 广灵县| 泸州市| 资中县| 武邑县| 祥云县| 抚远县| 开阳县| 封开县| 虞城县| 庆安县| 紫金县| 浮山县| 青州市| 荔波县| 博客| 柳林县| 靖江市| 长沙县| 丽江市| 海兴县| 漳平市| 安陆市| 托克托县| 驻马店市| 钟祥市|