(g1)
| 496 | |
| 497 | |
| 498 | def test_H_T_group(g1): |
| 499 | import torch |
| 500 | |
| 501 | g1.add_hyperedges([0, 4, 5], group_name="knn") |
| 502 | assert ( |
| 503 | g1.H_T.to_dense().cpu() |
| 504 | == torch.tensor( |
| 505 | [ |
| 506 | [1, 1, 0, 1], |
| 507 | [1, 1, 0, 0], |
| 508 | [1, 0, 1, 0], |
| 509 | [0, 0, 1, 0], |
| 510 | [0, 0, 1, 1], |
| 511 | [1, 0, 0, 1], |
| 512 | ] |
| 513 | ).t() |
| 514 | ).all() |
| 515 | assert ( |
| 516 | g1.H_T_of_group("main").to_dense().cpu() |
| 517 | == torch.tensor( |
| 518 | [[1, 1, 0], [1, 1, 0], [1, 0, 1], [0, 0, 1], [0, 0, 1], [1, 0, 0]] |
| 519 | ).t() |
| 520 | ).all() |
| 521 | assert ( |
| 522 | g1.H_T_of_group("knn").to_dense().cpu() == torch.tensor([[1, 0, 0, 0, 1, 1]]) |
| 523 | ).all() |
| 524 | |
| 525 | |
| 526 | def test_W_e(g2): |
nothing calls this directly
no test coverage detected