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

Method test_zipdataset

tests/data/test_dataloader.py:92–99  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

90 self.assertListEqual(output, [594, 170, 292, 589, 153, 811, 21, 550])
91
92 def test_zipdataset(self):
93 dataset = ZipDataset([_RandomDataset(), ZipDataset([_RandomDataset(), _RandomDataset()])])
94 dataloader = DataLoader(dataset, batch_size=2, num_workers=2)
95 output = []
96 for _ in range(2):
97 for batch in dataloader:
98 output.extend([convert_to_numpy(batch, wrap_sequence=False)])
99 assert_allclose(np.stack(output).flatten()[:7], np.array([594, 170, 594, 170, 594, 170, 524]))
100
101
102if __name__ == "__main__":

Callers

nothing calls this directly

Calls 8

ZipDatasetClass · 0.90
DataLoaderClass · 0.90
convert_to_numpyFunction · 0.90
assert_allcloseFunction · 0.90
_RandomDatasetClass · 0.85
extendMethod · 0.80
arrayMethod · 0.80
flattenMethod · 0.45

Tested by

no test coverage detected