def test_randomize(self):
    dataset = _RandomDataset()
    dataloader = DataLoader(dataset, batch_size=2, num_workers=3)
    output = []
    for _ in range(2):
        for batch in dataloader:
            output.extend(batch.data.numpy().flatten().tolist())
    self.assertListEqual(output, [594, 170, 524, 778, 370, 906, 292, 589, 762, 763, 156, 886, 42, 405, 221, 166])
def test_randomize(self):
    dataset = _RandomDataset()
    dataloader = DataLoader(dataset, batch_size=2, num_workers=3)
    output = []
    for _ in range(2):
        for batch in dataloader:
            output.extend(batch.data.numpy().flatten().tolist())
    self.assertListEqual(output, [594, 170, 524, 778, 370, 906, 292, 589, 762, 763, 156, 886, 42, 405, 221, 166])