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

Casting a tensor to a NumPy/Python variable

Should you need to, you can cast a tensor to a numpy variable as follows:

print(t2.numpy())

The output will be as follows:

[[[ 0. 1. 2.] [ 3. 4. 5.]] [[ 6. 7. 8.] [ 9. 10. 11.]]]

Take this, also:

print(t2[1, 0, 2].numpy())

The output will be as follows:

8.0
主站蜘蛛池模板: 那曲县| 遵化市| 扶绥县| 额敏县| 大名县| 泾源县| 乐山市| 贵州省| 光泽县| 梨树县| 望谟县| 睢宁县| 民丰县| 德保县| 金湖县| 台东县| 五华县| 沁源县| 江川县| 兴隆县| 长葛市| 盐池县| 尼勒克县| 鄂尔多斯市| 扶绥县| 高陵县| 江川县| 中西区| 凤城市| 上虞市| 伊川县| 乐平市| 信阳市| 松溪县| 武宁县| 汾西县| 长海县| 鄂伦春自治旗| 洞口县| 普定县| 贺兰县|