def test_diff_complex128(self): x = np.array([1.3+2.0j, 2.7-3.9j, 4.9+1.0j, 5.1-9.0j], np.complex128) x_gpu = gpuarray.to_gpu(x) y_gpu = misc.diff(x_gpu) assert_allclose(y_gpu.get(), np.diff(x), rtol=dtype_to_rtol[np.complex128], atol=dtype_to_atol[np.complex128])
def test_diff_float64(self): x = np.array([1.3, 2.7, 4.9, 5.1], np.float64) x_gpu = gpuarray.to_gpu(x) y_gpu = misc.diff(x_gpu) assert_allclose(y_gpu.get(), np.diff(x), rtol=dtype_to_rtol[np.float64], atol=dtype_to_atol[np.float64])
def test_diff_complex128(self): x = np.array([1.3 + 2.0j, 2.7 - 3.9j, 4.9 + 1.0j, 5.1 - 9.0j], np.complex128) x_gpu = gpuarray.to_gpu(x) y_gpu = misc.diff(x_gpu) assert_allclose(y_gpu.get(), np.diff(x), rtol=dtype_to_rtol[np.complex128], atol=dtype_to_atol[np.complex128])
def slice_widths(self): '''Array of the widths of the slices.''' return diff(self.z_bins)
def test_diff_complex128(self): x = np.array([1.3 + 2.0j, 2.7 - 3.9j, 4.9 + 1.0j, 5.1 - 9.0j], np.complex128) x_gpu = gpuarray.to_gpu(x) y_gpu = misc.diff(x_gpu) assert np.allclose(y_gpu.get(), np.diff(x))
def test_diff_float64(self): x = np.array([1.3, 2.7, 4.9, 5.1], np.float64) x_gpu = gpuarray.to_gpu(x) y_gpu = misc.diff(x_gpu) assert np.allclose(y_gpu.get(), np.diff(x))
def test_diff_complex128(self): x = np.array([1.3+2.0j, 2.7-3.9j, 4.9+1.0j, 5.1-9.0j], np.complex128) x_gpu = gpuarray.to_gpu(x) y_gpu = misc.diff(x_gpu) assert np.allclose(y_gpu.get(), np.diff(x))