MCPcopy Create free account
hub / github.com/Project-MONAI/MONAI / test_metatensor

Method test_metatensor

tests/data/test_gdsdataset.py:106–111  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

104 assert_allclose(items[0], p(np.arange(0, np.prod(shape)).reshape(shape)))
105
106 def test_metatensor(self):
107 shape = (1, 10, 9, 8)
108 items = [TEST_NDARRAYS[-1](np.arange(0, np.prod(shape)).reshape(shape))]
109 with tempfile.TemporaryDirectory() as tempdir:
110 ds = GDSDataset(data=items, transform=_InplaceXform(), cache_dir=tempdir, device=0)
111 assert_allclose(ds[0], ds[0][0], type_test=False)
112
113 def test_dtype(self):
114 shape = (1, 10, 9, 8)

Callers

nothing calls this directly

Calls 3

GDSDatasetClass · 0.90
assert_allcloseFunction · 0.90
_InplaceXformClass · 0.70

Tested by

no test coverage detected