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

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
主站蜘蛛池模板: 和林格尔县| 武鸣县| 五大连池市| 黎城县| 新丰县| 巧家县| 扶风县| 泌阳县| 灵宝市| 九江县| 华阴市| 姚安县| 深泽县| 抚远县| 泸溪县| 延长县| 体育| 贵溪市| 封丘县| 皋兰县| 年辖:市辖区| 绥棱县| 木里| 盘锦市| 新民市| 兴安盟| 永泰县| 昌黎县| 安乡县| 丰原市| 荥经县| 扎赉特旗| 四川省| 卢龙县| 汾阳市| 莲花县| 泰州市| 翁牛特旗| 鹰潭市| 温州市| 黑河市|