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

Broadcasting

Element-wise tensor operations support broadcasting in the same way that NumPy arrays do. The simplest example is that of multiplying a tensor by a scalar:

t4 = t2*4
print(t4)

The output will be as follows:

tf.Tensor( [[[ 0. 4. 8.] [12. 16. 20.]] [[24. 28. 32.] [36. 40. 44.]]], shape=(2, 2, 3), dtype=float32)

In this example, the scalar multiplier 4 is—conceptually, at least—expanded into an array that can be multiplied element-wise with t2. There is a very detailed discussion of broadcasting at https://docs.scipy.org/doc/numpy/user/basics.broadcasting.html.

主站蜘蛛池模板: 麻栗坡县| 永泰县| 怀柔区| 荥阳市| 扬中市| 聂拉木县| 曲沃县| 新建县| 民乐县| 江达县| 天全县| 兰西县| 柯坪县| 三门峡市| 达日县| 海口市| 盘锦市| 岳阳市| 佛坪县| 奉节县| 孝感市| 刚察县| 沙坪坝区| 五大连池市| 子长县| 湘乡市| 嘉荫县| 忻州市| 隆回县| 墨玉县| 阿城市| 桂林市| 鹤庆县| 阿瓦提县| 南汇区| 泌阳县| 龙岩市| 莒南县| 株洲市| 会理县| 乌鲁木齐市|