Beispiel #1
0
def test_compose(input, idx, axis):
    t = transforms.Compose(
        [transforms.Crop(idx, axis=axis),
         transforms.Normalize(axis=axis)])
    expected_output = F.crop(input, idx, axis=axis)
    expected_output = F.normalize(expected_output, axis=axis)
    assert np.array_equal(t(input), expected_output)
Beispiel #2
0
def test_normalize(input, axis, expected_output):
    output = F.normalize(input, axis=axis)
    assert np.array_equal(output, expected_output)