Skip to content

Commit

Permalink
Update @withMETIS decorator to test against torch-sparse (#9066)
Browse files Browse the repository at this point in the history
  • Loading branch information
rusty1s committed Mar 18, 2024
1 parent 18d38c9 commit a1a3724
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions torch_geometric/testing/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,11 @@ def withMETIS(func: Callable) -> Callable:

if with_metis:
try: # Test that METIS can succesfully execute:
import pyg_lib
# TODO Using `pyg-lib` metis partitioning leads to some weird bugs
# in the # CI. As such, we require `torch-sparse` for now.
rowptr = torch.tensor([0, 2, 4, 6])
col = torch.tensor([1, 2, 0, 2, 1, 0])
pyg_lib.partition.metis(rowptr, col, num_partitions=2)
torch.ops.torch_sparse.partition(rowptr, col, None, 2, True)
except Exception:
with_metis = False

Expand Down

0 comments on commit a1a3724

Please sign in to comment.