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

Function test_hypersparse_query

tests/python/common/test_heterograph-misc.py:399–415  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

397
398
399def test_hypersparse_query():
400 g = dgl.graph([])
401 g = g.to(F.ctx())
402 g.add_nodes(1000001)
403 g.add_edges([0], [1])
404 for i in range(10):
405 assert g.has_nodes(i)
406 assert not g.has_nodes(1000002)
407 assert g.edge_ids(0, 1) == 0
408 src, dst = g.find_edges([0])
409 src, dst, eid = g.in_edges(1, form="all")
410 src, dst, eid = g.out_edges(0, form="all")
411 src, dst = g.edges()
412 assert g.in_degrees(0) == 0
413 assert g.in_degrees(1) == 1
414 assert g.out_degrees(0) == 1
415 assert g.out_degrees(1) == 0
416
417
418def test_empty_data_initialized():

Callers 1

Calls 13

graphMethod · 0.45
toMethod · 0.45
ctxMethod · 0.45
add_nodesMethod · 0.45
add_edgesMethod · 0.45
has_nodesMethod · 0.45
edge_idsMethod · 0.45
find_edgesMethod · 0.45
in_edgesMethod · 0.45
out_edgesMethod · 0.45
edgesMethod · 0.45
in_degreesMethod · 0.45

Tested by

no test coverage detected