-
I am confused how is_sorted works in pytorch geometric's neighborloader. According to the docs, if you the data's edge_index is sorted by column, you can use is_sorted=true to save time and memory. However, when I try it, I receive substantially different batch sizes. I asked this question on stackexchange but I figured this would be a more appropriate place. Here's an example:
Output:
I think this edge_index is sorted by column unless I'm really mis-understanding what they mean by sorted by column. We then can see that the batch size is 17 vs 3 for I am running with pytorch version 1.12.1 and pytorch geometric version 2.2.0. Any advice would be much appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Your edge indices are sorted row-wise (i.e |
Beta Was this translation helpful? Give feedback.
Your edge indices are sorted row-wise (i.e
edge_index[0]
) it should be sorted by column (i.eedge_index[1]
). Use the coalesce withsort_by_row=False
to sort by column, note: this will remove repeated edges.