(g1)
| 456 | |
| 457 | |
| 458 | def test_H_group(g1): |
| 459 | import torch |
| 460 | |
| 461 | g1.add_hyperedges([0, 4, 5], group_name="knn") |
| 462 | assert ( |
| 463 | g1.H.to_dense().cpu() |
| 464 | == torch.tensor( |
| 465 | [ |
| 466 | [1, 1, 0, 1], |
| 467 | [1, 1, 0, 0], |
| 468 | [1, 0, 1, 0], |
| 469 | [0, 0, 1, 0], |
| 470 | [0, 0, 1, 1], |
| 471 | [1, 0, 0, 1], |
| 472 | ] |
| 473 | ) |
| 474 | ).all() |
| 475 | assert ( |
| 476 | g1.H_of_group("main").to_dense().cpu() |
| 477 | == torch.tensor( |
| 478 | [[1, 1, 0], [1, 1, 0], [1, 0, 1], [0, 0, 1], [0, 0, 1], [1, 0, 0]] |
| 479 | ) |
| 480 | ).all() |
| 481 | assert ( |
| 482 | g1.H_of_group("knn").to_dense().cpu() |
| 483 | == torch.tensor([[1], [0], [0], [0], [1], [1]]) |
| 484 | ).all() |
| 485 | |
| 486 | |
| 487 | def test_H_T(g1): |
nothing calls this directly
no test coverage detected