(g1)
| 382 | |
| 383 | |
| 384 | def test_v2e_index_group(g1): |
| 385 | import torch |
| 386 | |
| 387 | v2e_src = g1.v2e_src_of_group("main").view(-1, 1) |
| 388 | v2e_dst = g1.v2e_dst_of_group("main").view(-1, 1) |
| 389 | |
| 390 | index = torch.cat((v2e_src, v2e_dst), dim=1) |
| 391 | index = index.numpy().tolist() |
| 392 | index = list(map(lambda x: tuple(x), index)) |
| 393 | |
| 394 | assert (0, 0) in index |
| 395 | assert (1, 0) in index |
| 396 | assert (2, 0) in index |
| 397 | assert (5, 0) in index |
| 398 | assert (0, 1) in index |
| 399 | assert (1, 1) in index |
| 400 | assert (2, 2) in index |
| 401 | assert (3, 2) in index |
| 402 | assert (4, 2) in index |
| 403 | |
| 404 | |
| 405 | def test_e2v_index(g1): |
nothing calls this directly
no test coverage detected