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

Function test_serialize_empty_dict

tests/python/common/data/test_serialize.py:171–185  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

169
170
171def test_serialize_empty_dict():
172 # create a temporary file and immediately release it so DGL can open it.
173 f = tempfile.NamedTemporaryFile(delete=False)
174 path = f.name
175 f.close()
176
177 tensor_dict = {}
178
179 save_tensors(path, tensor_dict)
180
181 load_tensor_dict = load_tensors(path)
182 assert isinstance(load_tensor_dict, dict)
183 assert len(load_tensor_dict) == 0
184
185 os.unlink(path)
186
187
188def load_old_files(files):

Callers

nothing calls this directly

Calls 3

save_tensorsFunction · 0.85
load_tensorsFunction · 0.85
closeMethod · 0.45

Tested by

no test coverage detected