fix numpy code op test

This commit is contained in:
Dun Liang 2020-08-11 19:53:48 +08:00
parent ed65ba76e6
commit e25a8ac28d
3 changed files with 11 additions and 11 deletions

View File

@ -7,7 +7,7 @@
# This file is subject to the terms and conditions defined in
# file 'LICENSE.txt', which is part of this source code package.
# ***************************************************************
__version__ = '1.1.7.4'
__version__ = '1.1.7.5'
from . import lock
with lock.lock_scope():
from . import compiler

View File

@ -58,9 +58,9 @@ class TestCodeOp(unittest.TestCase):
one=numpy.ones(a.shape)
assert numpy.allclose(da.data,one*2.0)
jt.flags.use_cuda = 0
check()
jt.flags.use_cuda = 1
if jt.has_cuda:
with jt.flag_scope(use_cuda=1):
check()
check()
def test(self):
@ -92,9 +92,9 @@ class TestCodeOp(unittest.TestCase):
one=numpy.ones(a.shape)
assert numpy.allclose(da.data,one*2.0)
jt.flags.use_cuda = 0
check()
jt.flags.use_cuda = 1
if jt.has_cuda:
with jt.flag_scope(use_cuda=1):
check()
check()
def test_multi_input(self):
@ -139,9 +139,9 @@ class TestCodeOp(unittest.TestCase):
assert numpy.allclose(dda.data,one)
assert numpy.allclose(ddb.data,mone)
jt.flags.use_cuda = 0
check()
jt.flags.use_cuda = 1
if jt.has_cuda:
with jt.flag_scope(use_cuda=1):
check()
check()
@unittest.skipIf(True, "Memory leak testing is not in progress, Skip")

View File

@ -36,7 +36,7 @@ class TestParallelPass(unittest.TestCase):
b = jt.random((n, n))
a.data, b.data
with jt.profile_scope(compile_options = {
"compile_shapes":1, "parallel":1
"compile_shapes":1, "parallel":2, "try_use_32bit_index":use_int32
}, try_use_32bit_index = use_int32) as rep:
c = a + b
nc = c.data