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

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.

主站蜘蛛池模板: 沭阳县| 山东省| 郸城县| 唐河县| 探索| 固安县| 洞头县| 扎兰屯市| 南漳县| 阳东县| 湘潭县| 如东县| 玉门市| 安国市| 丹巴县| 卓资县| 绥阳县| 乌海市| 武隆县| 兴国县| 通榆县| 轮台县| 蒙城县| 云梦县| 舞阳县| 义乌市| 浙江省| 密山市| 文化| 辽源市| 惠东县| 永福县| 宜宾市| 崇州市| 吴堡县| 苏尼特右旗| 奉新县| 东方市| 时尚| 从江县| 静乐县|