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

Function test_v2e_index_group

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

Source from the content-addressed store, hash-verified

382
383
384def 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
405def test_e2v_index(g1):

Callers

nothing calls this directly

Calls 2

v2e_src_of_groupMethod · 0.80
v2e_dst_of_groupMethod · 0.80

Tested by

no test coverage detected