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

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
主站蜘蛛池模板: 昔阳县| 永靖县| 昆明市| 武平县| 博客| 镇康县| 武安市| 蒙山县| 星座| 高邮市| 长垣县| 泸州市| 两当县| 淮滨县| 呼图壁县| 安徽省| 尚志市| 青铜峡市| 咸宁市| 平江县| 金溪县| 余姚市| 云南省| 松潘县| 荣昌县| 乐东| 新绛县| 黑河市| 台前县| 饶平县| 开江县| 云林县| 青岛市| 红桥区| 南岸区| 独山县| 武安市| 桂东县| 康马县| 凌海市| 日照市|