def test_compat_Zpad(backend, X,Y,Z, P, K):
pymr = pytest.importorskip('pymr')
b = backend()
i_shape = (X, Y, Z, K)
o_shape = (X+2*P, Y+2*P, Z+2*P, K)
x = indigo.util.rand64c( *i_shape )
D0 = pymr.linop.Zpad( o_shape, i_shape, dtype=x.dtype )
D1 = b.Zpad(o_shape[:3], i_shape[:3], dtype=x.dtype)
x_indigo = np.asfortranarray(x.reshape((-1,K), order='F'))
x_pmr = pymr.util.vec(x)
y_exp = D0 * x_pmr
y_act = D1 * x_indigo
y_act = y_act.flatten(order='F')
npt.assert_equal(y_act, y_exp)
评论列表
文章目录