
In [1]: import torch
In [2]: x=torch.randn(2)
In [3]: w=torch.randn(2,3)
In [4]: x@w
Out[4]: tensor([0.9364, 1.3934, 0.3611])
In [5]: _.shape
Out[5]: torch.Size([3])
In [8]: x.repeat(2,1)
Out[8]:
tensor([[ 0.2738, -1.1417],
[ 0.2738, -1.1417]])
In [9]: x.repeat(2

本文深入探讨PyTorch库中的_C模块,重点解析如何使用该模块进行高效矩阵乘法操作,结合抽象代数概念,阐述底层计算原理。
最低0.47元/天 解锁文章
2220

被折叠的 条评论
为什么被折叠?



