def test_random_zoom_error(): with pytest.raises(ValueError): affine_transformations.random_zoom(0, zoom_range=[0])
def test_random_zoom(): x = np.random.random((2, 28, 28)) assert affine_transformations.random_zoom(x, (5, 5)).shape == (2, 28, 28) assert np.allclose(x, affine_transformations.random_zoom(x, (1, 1)))