示例#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))