Пример #1
0
 def test_cumsum_complex64(self):
     x = np.array([1, 4j, 3, 2j, 8], np.complex64)
     x_gpu = gpuarray.to_gpu(x)
     c_gpu = misc.cumsum(x_gpu)
     assert_allclose(c_gpu.get(), np.cumsum(x),
                     rtol=dtype_to_rtol[np.complex64],
                     atol=dtype_to_atol[np.complex64])
Пример #2
0
 def test_cumsum_float32(self):
     x = np.array([1, 4, 3, 2, 8], np.float32)
     x_gpu = gpuarray.to_gpu(x)
     c_gpu = misc.cumsum(x_gpu)
     assert_allclose(c_gpu.get(), np.cumsum(x),
                     rtol=dtype_to_rtol[np.float32],
                     atol=dtype_to_atol[np.float32])
Пример #3
0
 def test_cumsum_complex128(self):
     x = np.array([1, 4j, 3, 2j, 8], np.complex128)
     x_gpu = gpuarray.to_gpu(x)
     c_gpu = misc.cumsum(x_gpu)
     assert_allclose(c_gpu.get(),
                     np.cumsum(x),
                     rtol=dtype_to_rtol[np.complex128],
                     atol=dtype_to_atol[np.complex128])
Пример #4
0
 def test_cumsum_float64(self):
     x = np.array([1, 4, 3, 2, 8], np.float64)
     x_gpu = gpuarray.to_gpu(x)
     c_gpu = misc.cumsum(x_gpu)
     assert_allclose(c_gpu.get(),
                     np.cumsum(x),
                     rtol=dtype_to_rtol[np.float64],
                     atol=dtype_to_atol[np.float64])
Пример #5
0
 def test_cumsum_complex128(self):
     x = np.array([1, 4j, 3, 2j, 8], np.complex128)
     x_gpu = gpuarray.to_gpu(x)
     c_gpu = misc.cumsum(x_gpu)
     assert np.allclose(c_gpu.get(), np.cumsum(x))
Пример #6
0
 def test_cumsum_float64(self):
     x = np.array([1, 4, 3, 2, 8], np.float64)
     x_gpu = gpuarray.to_gpu(x)
     c_gpu = misc.cumsum(x_gpu)
     assert np.allclose(c_gpu.get(), np.cumsum(x))
Пример #7
0
 def test_cumsum_complex128(self):
     x = np.array([1, 4j, 3, 2j, 8], np.complex128)
     x_gpu = gpuarray.to_gpu(x)
     c_gpu = misc.cumsum(x_gpu)
     assert np.allclose(c_gpu.get(), np.cumsum(x))
Пример #8
0
 def test_cumsum_float64(self):
     x = np.array([1, 4, 3, 2, 8], np.float64)
     x_gpu = gpuarray.to_gpu(x)
     c_gpu = misc.cumsum(x_gpu)
     assert np.allclose(c_gpu.get(), np.cumsum(x))