MCPcopy Index your code
hub / github.com/dmlc/dgl / test_serialize_deserialize_plain

Function test_serialize_deserialize_plain

tests/python/common/test_frame.py:54–73  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

52
53
54def test_serialize_deserialize_plain():
55 data = F.copy_to(
56 F.tensor(
57 [
58 [1.0, 1.0, 1.0, 1.0],
59 [0.0, 2.0, 9.0, 0.0],
60 [3.0, 2.0, 1.0, 0.0],
61 [1.0, 1.0, 1.0, 1.0],
62 [0.0, 2.0, 4.0, 0.0],
63 ]
64 ),
65 F.ctx(),
66 )
67 original = Column(data)
68
69 serial = pickle.dumps(original)
70 new = pickle.loads(serial)
71 print("new = {}".format(new))
72
73 assert F.array_equal(new.data, original.data)
74
75
76def test_serialize_deserialize_subcolumn():

Callers

nothing calls this directly

Calls 4

ColumnClass · 0.90
formatMethod · 0.80
copy_toMethod · 0.45
ctxMethod · 0.45

Tested by

no test coverage detected