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

Function test_RandomSampler

imperative/python/test/unit/data/test_sampler.py:24–30  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

22
23
24def test_RandomSampler():
25 indices = list(range(20))
26 indices_copy = copy.deepcopy(indices)
27 sampler = RandomSampler(ArrayDataset(indices_copy))
28 sample_indices = sampler
29 assert indices != list(each[0] for each in sample_indices)
30 assert indices == sorted(list(each[0] for each in sample_indices))
31
32
33def test_InfiniteSampler():

Callers

nothing calls this directly

Calls 3

RandomSamplerClass · 0.90
ArrayDatasetClass · 0.90
listFunction · 0.85

Tested by

no test coverage detected