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

Function _check_device

tests/python/pytorch/dataloading/test_dataloader.py:215–223  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

213
214
215def _check_device(data):
216 if isinstance(data, dict):
217 for k, v in data.items():
218 assert v.device == F.ctx()
219 elif isinstance(data, list):
220 for v in data:
221 assert v.device == F.ctx()
222 else:
223 assert data.device == F.ctx()
224
225
226@pytest.mark.parametrize("sampler_name", ["full", "neighbor"])

Callers 2

test_node_dataloaderFunction · 0.85
test_edge_dataloaderFunction · 0.85

Calls 2

itemsMethod · 0.45
ctxMethod · 0.45

Tested by

no test coverage detected