MCPcopy
hub / github.com/dmlc/dgl / create_test_heterograph

Function create_test_heterograph

tests/python/common/ops/test_edge_softmax.py:59–80  ·  view source on GitHub ↗
(idtype)

Source from the content-addressed store, hash-verified

57
58
59def create_test_heterograph(idtype):
60 # test heterograph from the docstring, plus a user -- wishes -- game relation
61 # 3 users, 2 games, 2 developers
62 # metagraph:
63 # ('user', 'follows', 'user'),
64 # ('user', 'plays', 'game'),
65 # ('user', 'wishes', 'game'),
66 # ('developer', 'develops', 'game')])
67
68 g = dgl.heterograph(
69 {
70 ("user", "follows", "user"): ([0, 1, 2, 1, 1], [0, 0, 1, 1, 2]),
71 ("user", "plays", "game"): ([0, 1, 2, 1], [0, 0, 1, 1]),
72 ("user", "wishes", "game"): ([0, 1, 1], [0, 0, 1]),
73 ("developer", "develops", "game"): ([0, 1, 0], [0, 1, 1]),
74 },
75 idtype=idtype,
76 device=F.ctx(),
77 )
78 assert g.idtype == idtype
79 assert g.device == F.ctx()
80 return g
81
82
83@unittest.skipIf(

Callers 1

test_edge_softmaxFunction · 0.70

Calls 1

ctxMethod · 0.45

Tested by

no test coverage detected