bug : AttributeError: module ‘torch‘ has no attribute ‘ops‘

为啥,怎么解决,还不知道。

import torch
from torch_geometric.data import Data

edge_index = torch.tensor([[0, 1, 1, 2],
                           [1, 0, 2, 1]], dtype=torch.long)
x = torch.tensor([[-1], [0], [1]], dtype=torch.float)

data = Data(x=x, edge_index=edge_index)
Data(edge_index=[2, 4], x=[3, 1])

为什么出现
怎么改
出现了好几次了。

又出现了,这样的代码出现了同样的bug

from torch_geometric.datasets import Planetoid

dataset = Planetoid(root='/Cora', name='Cora')
Cora()

猜你喜欢

转载自blog.csdn.net/weixin_40945354/article/details/107672657