已安装焊炬,但未找到重复交叉

2024-04-25 21:07:12 发布

您现在位置:Python中文网/ 问答频道 /正文

我已经安装了PyTorch。 import torch运行时没有错误。但是,未找到函数^{}

x = torch.tensor([1, 2, 3])
x.repeat_interleave(2)

给出AttributeError: 'Tensor' object has no attribute 'repeat_interleave'

为什么?


Tags: 函数noimportobject错误attributetorchpytorch