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

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.

主站蜘蛛池模板: 海安县| 阿拉尔市| 洛南县| 肥城市| 玉树县| 唐山市| 兴和县| 墨玉县| 九寨沟县| 东乡族自治县| 桐乡市| 彰武县| 满洲里市| 鹰潭市| 肃北| 兴业县| 库伦旗| 渭源县| 沅陵县| 镶黄旗| 澄迈县| 长海县| 新建县| 方山县| 南岸区| 黑山县| 江陵县| 东丽区| 比如县| 搜索| 宜章县| 中西区| 孝感市| 玛沁县| 吐鲁番市| 清水河县| 舒兰市| 军事| 广德县| 贵州省| 宁明县|