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

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.

主站蜘蛛池模板: 白银市| 长阳| 巴彦淖尔市| 保山市| 浦江县| 苏州市| 小金县| 江达县| 佛冈县| 濮阳县| 宜兴市| 滦平县| 北京市| 望谟县| 郁南县| 古交市| 荆州市| 萨嘎县| 闽清县| 稷山县| 象州县| 馆陶县| 红河县| 常州市| 岳西县| 乳源| 兴海县| 武夷山市| 隆安县| 高清| 陆河县| 丹东市| 沙河市| 太保市| 如皋市| 桑日县| 西贡区| 高邮市| 吉水县| 陆川县| 蓬莱市|