()
| 35 | |
| 36 | |
| 37 | def test_concat_dataset(): |
| 38 | size1 = (10,) |
| 39 | size2 = (20,) |
| 40 | data_shape1 = (3, 256, 256) |
| 41 | data_shape2 = (2, 128, 128) |
| 42 | label_shape1 = (1,) |
| 43 | label_shape2 = (2,) |
| 44 | data1 = np.random.randint(0, 255, size1 + data_shape1) |
| 45 | data2 = np.random.randint(0, 255, size2 + data_shape2) |
| 46 | label1 = np.random.randint(0, 9, size1 + label_shape1) |
| 47 | label2 = np.random.randint(0, 9, size2 + label_shape2) |
| 48 | dataset1 = ArrayDataset(data1, label1) |
| 49 | dataset2 = ArrayDataset(data2, label2) |
| 50 | dataset = ConcatDataset([dataset1, dataset2]) |
| 51 | assert dataset[15][0].shape == data_shape2 |
| 52 | assert dataset[15][1].shape == label_shape2 |
nothing calls this directly
no test coverage detected