예제 #1
0
 def test_func(self, *args, **kw):
     kw[name] = cupy
     x = impl(self, *args, **kw)
     kw[name] = numpy
     y = impl(self, *args, **kw)
     self.assertIsNotNone(x)
     self.assertIsNotNone(y)
     array.assert_allclose(x, y, rtol, atol, err_msg, verbose)
     if type_check:
         self.assertEqual(x.dtype, y.dtype)
예제 #2
0
파일: helper.py 프로젝트: takiyu/chainer
 def test_func(self, *args, **kw):
     kw[name] = cupy
     x = impl(self, *args, **kw)
     kw[name] = numpy
     y = impl(self, *args, **kw)
     self.assertIsNotNone(x)
     self.assertIsNotNone(y)
     array.assert_allclose(x, y, rtol, atol, err_msg, verbose)
     if type_check:
         self.assertEqual(x.dtype, y.dtype)
예제 #3
0
 def check_func(cupy_result, numpy_result):
     c = cupy_result
     n = numpy_result
     array.assert_allclose(c, n, rtol, atol, err_msg, verbose)
     if contiguous_check and isinstance(n, numpy.ndarray):
         if n.flags.c_contiguous and not c.flags.c_contiguous:
             raise AssertionError(
                 'The state of c_contiguous flag is false. '
                 '(cupy_result:{} numpy_result:{})'.format(
                     c.flags.c_contiguous, n.flags.c_contiguous))
         if n.flags.f_contiguous and not c.flags.f_contiguous:
             raise AssertionError(
                 'The state of f_contiguous flag is false. '
                 '(cupy_result:{} numpy_result:{})'.format(
                     c.flags.f_contiguous, n.flags.f_contiguous))
예제 #4
0
파일: helper.py 프로젝트: espg/cupy
 def check_func(c, n):
     c_array = c
     n_array = n
     if sp_name is not None:
         import scipy.sparse
         if cupyx.scipy.sparse.issparse(c):
             c_array = c.A
         if scipy.sparse.issparse(n):
             n_array = n.A
     array.assert_allclose(c_array, n_array, rtol, atol, err_msg, verbose)
     if contiguous_check and isinstance(n, numpy.ndarray):
         if n.flags.c_contiguous and not c.flags.c_contiguous:
             raise AssertionError(
                 'The state of c_contiguous flag is false. '
                 '(cupy_result:{} numpy_result:{})'.format(
                     c.flags.c_contiguous, n.flags.c_contiguous))
         if n.flags.f_contiguous and not c.flags.f_contiguous:
             raise AssertionError(
                 'The state of f_contiguous flag is false. '
                 '(cupy_result:{} numpy_result:{})'.format(
                     c.flags.f_contiguous, n.flags.f_contiguous))
예제 #5
0
파일: helper.py 프로젝트: bittnt/chainer
 def check_func(cupy_result, numpy_result):
     array.assert_allclose(cupy_result, numpy_result,
                           rtol, atol, err_msg, verbose)
예제 #6
0
 def check_func(cupy_result, numpy_result):
     array.assert_allclose(cupy_result, numpy_result, rtol, atol, err_msg,
                           verbose)
예제 #7
0
파일: helper.py 프로젝트: mritools/cupyimg
 def check_func(c, n):
     array.assert_allclose(c, n, rtol, atol, err_msg, verbose)
예제 #8
0
 def test_func(self, *args, **kw):
     kw[name] = cupy
     x = impl(self, *args, **kw)
     kw[name] = numpy
     y = impl(self, *args, **kw)
     array.assert_allclose(x, y, rtol, atol, err_msg, verbose)