Skip to content

Commit

Permalink
removed torch.tensor conversion of indices
Browse files Browse the repository at this point in the history
  • Loading branch information
Coerulatus committed Feb 14, 2025
1 parent 0ecc6b4 commit 937c348
Showing 1 changed file with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ def _has_neighbour(
continue
for node in self.random_graph.nodes:
if self.random_graph.has_edge(
simplex_point_a.item(), node
simplex_point_a, node
) and self.random_graph.has_edge(
simplex_point_b.item(), node
simplex_point_b, node
):
return True
return False
Expand All @@ -83,9 +83,7 @@ def test_lift_topology_random_graph(self):
graph = self.lifting_high.data2domain(self.random_data)
simplicial_complex = self.lifting_high.lifting(graph)

for simplex_points in torch.tensor(
simplicial_complex.skeleton(simplicial_complex.dim)
):
for simplex_points in simplicial_complex.skeleton(simplicial_complex.dim):
share_neighbour = self._has_neighbour(simplex_points)
assert share_neighbour, f"The simplex {simplex_points} does not have a common neighbour with all the nodes."

Expand All @@ -94,9 +92,7 @@ def test_lift_topology_star_graph(self):
graph = self.lifting_high.data2domain(self.star_data)
simplicial_complex = self.lifting_high.lifting(graph)

for simplex_points in torch.tensor(
simplicial_complex.skeleton(simplicial_complex.dim)
):
for simplex_points in simplicial_complex.skeleton(simplicial_complex.dim):
share_neighbour = self._has_neighbour(simplex_points)
assert share_neighbour, f"The simplex {simplex_points} does not have a common neighbour with all the nodes."

Expand Down

0 comments on commit 937c348

Please sign in to comment.