DerekGloudemans:

x = torch.matmul(torch.t(x),self.weight)


Hi Derek,
Thanks for the reply. I’ve revised the “forward” function adding that one line you mentioned, however it shows another error message:
    def forward(self, data):
        x, edge_index = data.x, data.edge_index
        **x = torch.matmul(torch.t(x),self.weight)**

        print("x:",x.size(), "e_idx", edge_index.size())
 
        #print("x_shape:", x.shape())
        x = self.conv1(x, edge_index)
        x = F.relu(x)
        x = F.dropout(x, training=self.training)
        x = self.conv2(x, edge_index)

        return F.log_softmax(x, dim=1)

Error messages:
['x', 'edge_index', 'num_classes']
tensor([[[1.],
         [1.],
         [0.],
         ...,
         [1.],
         [0.],
         [0.]]])
Traceback (most recent call last):
  File "gcn_pytorch.py", line 157, in <module>
    graph_learning(data)
  File "gcn_pytorch.py", line 132, in graph_learning
    out = model(data)
  File "/home/hliu/.conda/envs/hliuPython/lib/python3.6/site-packages/torch/nn/modules/module.py", line 547, in __call__
    result = self.forward(*input, **kwargs)
  File "gcn_pytorch.py", line 107, in forward
    x = torch.matmul(torch.t(x),self.weight)
RuntimeError: t() expects a tensor with <= 2 dimensions, but self is 3D