(self)
| 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 | |
| 102 | if __name__ == "__main__": |
nothing calls this directly
no test coverage detected