예제 #1
0
 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])
예제 #2
0
 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])
예제 #3
0
 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])
예제 #4
0
 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])
예제 #5
0
 def slice_widths(self):
     '''Array of the widths of the slices.'''
     return diff(self.z_bins)
예제 #6
0
 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))
예제 #7
0
 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))
예제 #8
0
 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))
예제 #9
0
 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))