MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / test_array_dataset

Function test_array_dataset

imperative/python/test/unit/data/test_dataset.py:18–27  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

16
17
18def test_array_dataset():
19 size = (10,)
20 data_shape = (3, 256, 256)
21 label_shape = (1,)
22 data = np.random.randint(0, 255, size + data_shape)
23 label = np.random.randint(0, 9, size + label_shape)
24 dataset = ArrayDataset(data, label)
25 assert dataset[0][0].shape == data_shape
26 assert dataset[0][1].shape == label_shape
27 assert len(dataset) == size[0]
28
29
30def test_array_dataset_dim_error():

Callers

nothing calls this directly

Calls 1

ArrayDatasetClass · 0.90

Tested by

no test coverage detected