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

Function test_pickling_index

tests/python/common/test_heterograph-pickle.py:76–87  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

74
75
76def test_pickling_index():
77 # normal index
78 i = toindex([1, 2, 3])
79 i.tousertensor()
80 i.todgltensor() # construct a dgl tensor which is unpicklable
81 i2 = _reconstruct_pickle(i)
82 _assert_is_identical_index(i, i2)
83
84 # slice index
85 i = toindex(slice(5, 10))
86 i2 = _reconstruct_pickle(i)
87 _assert_is_identical_index(i, i2)
88
89
90def test_pickling_graph_index():

Callers 1

Calls 5

toindexFunction · 0.90
tousertensorMethod · 0.80
todgltensorMethod · 0.80
_reconstruct_pickleFunction · 0.70

Tested by

no test coverage detected