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

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)
主站蜘蛛池模板: 浦县| 延川县| 普兰县| 永德县| 长沙市| 武川县| 原平市| 南丹县| 固原市| 新河县| 佛教| 汾西县| 金昌市| 台北市| 天全县| 东阿县| 新晃| 达孜县| 南雄市| 介休市| 当雄县| 涟源市| 阿勒泰市| 横山县| 磴口县| 正镶白旗| 沁源县| 宜良县| 武穴市| 皮山县| 铜鼓县| 资兴市| 秭归县| 电白县| 神农架林区| 左云县| 尚志市| 偃师市| 龙川县| 乐至县| 临沂市|