MCPcopy Create free account
hub / github.com/easy-graph/Easy-Graph / test_e2v_index_group

Function test_e2v_index_group

easygraph/classes/tests/test_hypergraph.py:426–444  ·  view source on GitHub ↗
(g1)

Source from the content-addressed store, hash-verified

424
425
426def test_e2v_index_group(g1):
427 import torch
428
429 e2v_src = g1.e2v_src_of_group("main").view(-1, 1)
430 e2v_dst = g1.e2v_dst_of_group("main").view(-1, 1)
431
432 index = torch.cat((e2v_src, e2v_dst), dim=1)
433 index = index.numpy().tolist()
434 index = list(map(lambda x: tuple(x), index))
435
436 assert (0, 0) in index
437 assert (0, 1) in index
438 assert (0, 2) in index
439 assert (0, 5) in index
440 assert (1, 0) in index
441 assert (1, 1) in index
442 assert (2, 2) in index
443 assert (2, 3) in index
444 assert (2, 4) in index
445
446
447def test_H(g1):

Callers

nothing calls this directly

Calls 2

e2v_src_of_groupMethod · 0.80
e2v_dst_of_groupMethod · 0.80

Tested by

no test coverage detected