If n==m, data.sort_by_time() does not seem to sort the edges properly. My guess is that it instead sorts the node attributed then. As a temporary fix, I added a manual sorting of all edge_attributes (including edge_index) for this case and only use data.sort_by_time() when n!=m in #246 . But we should work towards getting the bug fixed in PyG so that we do not need a workaround.