Machine learning 属性错误:模块';火炬';没有属性';swapaxes';

Machine learning 属性错误:模块';火炬';没有属性';swapaxes';,machine-learning,pytorch,torch,Machine Learning,Pytorch,Torch,由于某种原因,在Google Colab上使用PyTorch时,我无法使用并返回此错误。我是否缺少一些额外的导入或其他内容?这是因为colab使用的Pytorch版本1.7.0没有交换轴torch.transpose()基本上应该做同样的事情。torch.swapaxes实际上是自PyTorch 1.8.0(当前主分支)起的torch.transpose的别名

由于某种原因,在Google Colab上使用PyTorch时,我无法使用并返回此错误。我是否缺少一些额外的导入或其他内容?

这是因为colab使用的Pytorch版本1.7.0没有交换轴
torch.transpose()
基本上应该做同样的事情。
torch.swapaxes
实际上是自PyTorch 1.8.0(当前主分支)起的
torch.transpose的别名