Skip to content

Commit

Permalink
LineDiGraph transform: removed setting of num_edges
Browse files Browse the repository at this point in the history
  • Loading branch information
Flunzmas committed Jan 2, 2025
1 parent 4a05649 commit 093b7a2
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions torch_geometric/transforms/line_digraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ def forward(self, data: Data) -> Data:
mask = row.unsqueeze(0) == col.unsqueeze(1) # (num_edges, num_edges)
new_edge_index = torch.nonzero(mask).T

new_num_edges = new_edge_index.size(1)

# Obtain new edge attributes
if data.x is None or self.node_to_edge_features == 'none':
new_edge_attr = None
Expand All @@ -74,6 +72,5 @@ def forward(self, data: Data) -> Data:
data.edge_index = new_edge_index
data.x = edge_attr
data.num_nodes = new_num_nodes
data.num_edges = new_num_edges
data.edge_attr = new_edge_attr
return data

0 comments on commit 093b7a2

Please sign in to comment.