def test_gradient_takeo_double(): t = takeo.copy() t.pixels = t.pixels.astype(np.float64) grad_image = gradient(t) np_grad = _np_gradient(t.pixels) assert_allclose(grad_image.pixels, np_grad)
def test_gradient_takeo_float32(): dtype = np.float32 t = takeo.copy() t.pixels = t.pixels.astype(dtype) grad_image = gradient(t) _check_assertions(grad_image, t.shape, t.n_channels * 2, dtype) np_grad = _np_gradient(t.pixels) assert_allclose(grad_image.pixels, np_grad)