From 5f6c41d2448526e3541321eb389a659dd615b900 Mon Sep 17 00:00:00 2001 From: Michail Melonas Date: Mon, 9 Dec 2024 21:09:09 +0200 Subject: [PATCH] Add asserts to avoid linting failure --- .../transforms/add_orthornormal_node_identifiers.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/torch_geometric/transforms/add_orthornormal_node_identifiers.py b/torch_geometric/transforms/add_orthornormal_node_identifiers.py index d98a411f3860..0d2ac9ed2661 100644 --- a/torch_geometric/transforms/add_orthornormal_node_identifiers.py +++ b/torch_geometric/transforms/add_orthornormal_node_identifiers.py @@ -34,6 +34,9 @@ def __init__(self, d_p: int, use_laplacian: bool = True): self._use_laplacian = use_laplacian def forward(self, data: Data) -> Data: + assert data.num_nodes is not None + assert data.edge_index is not None + n = data.num_nodes if self._use_laplacian is True: node_ids = self._get_lap_eigenvectors(data.edge_index, n)