问题描述
我已经安装了PyTorch。
import torch
运行没有错误。但是,找不到函数torch.repeat_interleave()
:
x = torch.tensor([1,2,3])
x.repeat_interleave(2)
给予AttributeError: 'Tensor' object has no attribute 'repeat_interleave'
为什么?
解决方法
torch.repeat_interleave
版本的1.1.0
中引入了pytorch
运算符,因此,请考虑更新到1.1.0+
的{{1}}版本以顺利使用此方法。