动手学深度学习d2l——2预备知识
2.1.1. torch.view()和torch.reshape()的区别代码是用jupyter notebook写的import torchfrom ctypes import string_ata = torch.arange(6).reshape(2,3)a'''输出tensor([[0, 1, 2], [3, 4, 5]])'''a = a.Ta'''输出tensor([[0, 3], [1, 4], [2, 5]])'
原创
2021-11-30 13:48:00 ·
941 阅读 ·
0 评论