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

Function test_Compose

imperative/python/test/unit/data/test_transform.py:89–102  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

87
88
89def test_Compose():
90 t = Compose(
91 [
92 CenterCrop(output_size=CenterCrop_size),
93 RandomHorizontalFlip(prob=1),
94 ToMode(mode="CHW"),
95 ]
96 )
97 aug_data = t.apply_batch(generate_data())
98 aug_data_shape = [(a.shape, b.shape) for a, b in aug_data]
99 target_shape = [((3, 90, 70), label_shape)] * 4
100 assert aug_data_shape == target_shape, "aug {}, target {}".format(
101 aug_data_shape, target_shape
102 )

Callers

nothing calls this directly

Calls 7

apply_batchMethod · 0.95
ComposeClass · 0.85
CenterCropClass · 0.85
ToModeClass · 0.85
generate_dataFunction · 0.85
formatMethod · 0.45

Tested by

no test coverage detected