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

Finding the size (number of elements) of a tensor

The number of elements in a tensor is easily obtained. Notice also, again, the use of the .numpy() function to extract the Python value from the tensor:

s =  tf.size(input=t2).numpy()
s

The output will be as follows:

12
主站蜘蛛池模板: 望城县| 冷水江市| 鹤庆县| 余姚市| 安平县| 白山市| 象州县| 中牟县| 房产| 江源县| 秭归县| 玉山县| 阳泉市| 额敏县| 昭通市| 定襄县| 韶山市| 铜陵市| 军事| 清水河县| 含山县| 涿州市| 基隆市| 常宁市| 漳平市| 金昌市| 新邵县| 微博| 黎平县| 临沭县| 台中市| 罗源县| 元氏县| 克拉玛依市| 富平县| 甘孜| 靖江市| 卢氏县| 巴东县| 海原县| 岢岚县|