diff --git a/torch_geometric/typing.py b/torch_geometric/typing.py index 468f37abfaed..513f041847b1 100644 --- a/torch_geometric/typing.py +++ b/torch_geometric/typing.py @@ -345,6 +345,9 @@ def to_tuple(self) -> EdgeType: f"tuple since it holds invalid characters") return self.edge_type + def __reduce__(self) -> tuple[Any, Any]: + return (self.__class__, (self.edge_type, )) + # There exist some short-cuts to query edge-types (given that the full triplet # can be uniquely reconstructed, e.g.: