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

Function test_W_e_group

easygraph/classes/tests/test_hypergraph.py:532–540  ·  view source on GitHub ↗
(g2)

Source from the content-addressed store, hash-verified

530
531
532def test_W_e_group(g2):
533 import torch
534
535 g2.add_hyperedges([0, 4, 5], group_name="knn")
536 assert (g2.W_e.cpu()._values() == torch.tensor([0.5, 1, 0.5, 1, 0.5, 1])).all()
537 assert (
538 g2.W_e_of_group("main").cpu()._values() == torch.tensor([0.5, 1, 0.5, 1, 0.5])
539 ).all()
540 assert (g2.W_e_of_group("knn").cpu()._values() == torch.tensor([1])).all()
541
542
543def test_D(g1, g2):

Callers

nothing calls this directly

Calls 2

add_hyperedgesMethod · 0.45
W_e_of_groupMethod · 0.45

Tested by

no test coverage detected