After changing it to edge_index[0][idx] which I agree, I got an error which says “Index tensor must have the same number of dimensions as self tensor” as shown in the image. From the printed output, the edge_index[0][idx] which is the index in the index_select module returns a flattened tensor, whilst that of the edge_index tensor is a tuple with a “tensor” and size “none”, thus throwing an error that the two tensors have unequal dimensions. The None represents the size the of the edge_index tensor. You can probably have a look at the full message passing code I attached in my previous message to see how the edge_index tensor was created.
1817×87 43.1 KB