diff --git a/ci/windows/test_py2_cpu.ps1 b/ci/windows/test_py2_cpu.ps1 index 1c4a72682ae5..36c6f953fe14 100644 --- a/ci/windows/test_py2_cpu.ps1 +++ b/ci/windows/test_py2_cpu.ps1 @@ -23,7 +23,12 @@ $env:MXNET_STORAGE_FALLBACK_LOG_VERBOSE=0 $env:MXNET_HOME=[io.path]::combine($PSScriptRoot, 'mxnet_home') C:\Python27\Scripts\pip install -r tests\requirements.txt -C:\Python27\python.exe -m nose -v --with-timer --timer-ok 1 --timer-warning 15 --timer-filter warning,error --with-xunit --xunit-file nosetests_unittest.xml tests\python\unittest +# C:\Python27\python.exe -m nose -v --with-timer --timer-ok 1 --timer-warning 15 --timer-filter warning,error --with-xunit --xunit-file nosetests_unittest.xml tests\python\unittest +# if (! $?) { Throw ("Error running unittest") } +C:\Python27\python.exe -m nose -v --with-timer --timer-ok 1 --timer-warning 15 --timer-filter warning,error --with-xunit --xunit-file nosetests_unittest.xml tests\python\unittest\test_operator.py:test_norm if (! $?) { Throw ("Error running unittest") } -C:\Python27\python.exe -m nose -v --with-timer --timer-ok 1 --timer-warning 15 --timer-filter warning,error --with-xunit --xunit-file nosetests_train.xml tests\python\train -if (! $?) { Throw ("Error running train tests") } +$env:MXNET_SAFE_ACCUMULATION=1 +C:\Python27\python.exe -m nose -v --with-timer --timer-ok 1 --timer-warning 15 --timer-filter warning,error --with-xunit --xunit-file nosetests_unittest.xml tests\python\unittest\test_operator.py:test_norm +if (! $?) { Throw ("Error running unittest") } +# C:\Python27\python.exe -m nose -v --with-timer --timer-ok 1 --timer-warning 15 --timer-filter warning,error --with-xunit --xunit-file nosetests_train.xml tests\python\train +# if (! $?) { Throw ("Error running train tests") } diff --git a/ci/windows/test_py3_cpu.ps1 b/ci/windows/test_py3_cpu.ps1 index a7067f9f3f83..cf8d02fd00bb 100644 --- a/ci/windows/test_py3_cpu.ps1 +++ b/ci/windows/test_py3_cpu.ps1 @@ -23,7 +23,12 @@ $env:MXNET_STORAGE_FALLBACK_LOG_VERBOSE=0 $env:MXNET_HOME=[io.path]::combine($PSScriptRoot, 'mxnet_home') C:\Python37\Scripts\pip install -r tests\requirements.txt -C:\Python37\python.exe -m nose -v --with-timer --timer-ok 1 --timer-warning 15 --timer-filter warning,error --with-xunit --xunit-file nosetests_unittest.xml tests\python\unittest +C:\Python37\python.exe -m nose -v --with-timer --timer-ok 1 --timer-warning 15 --timer-filter warning,error --with-xunit --xunit-file nosetests_unittest.xml tests\python\unittest\test_operator.py:test_norm if (! $?) { Throw ("Error running unittest") } -C:\Python37\python.exe -m nose -v --with-timer --timer-ok 1 --timer-warning 15 --timer-filter warning,error --with-xunit --xunit-file nosetests_train.xml tests\python\train -if (! $?) { Throw ("Error running train tests") } +$env:MXNET_SAFE_ACCUMULATION=1 +C:\Python37\python.exe -m nose -v --with-timer --timer-ok 1 --timer-warning 15 --timer-filter warning,error --with-xunit --xunit-file nosetests_unittest.xml tests\python\unittest\test_operator.py:test_norm +if (! $?) { Throw ("Error running unittest") } +# C:\Python37\python.exe -m nose -v --with-timer --timer-ok 1 --timer-warning 15 --timer-filter warning,error --with-xunit --xunit-file nosetests_unittest.xml tests\python\unittest +# if (! $?) { Throw ("Error running unittest") } +# C:\Python37\python.exe -m nose -v --with-timer --timer-ok 1 --timer-warning 15 --timer-filter warning,error --with-xunit --xunit-file nosetests_train.xml tests\python\train +# if (! $?) { Throw ("Error running train tests") } diff --git a/tests/python/unittest/test_operator.py b/tests/python/unittest/test_operator.py index 2ee471cfabc8..bc9605b29116 100644 --- a/tests/python/unittest/test_operator.py +++ b/tests/python/unittest/test_operator.py @@ -8401,9 +8401,13 @@ def l2norm(input_data, axis=0, keepdims=True): np.int32: 'int32', np.int64: 'int64'} is_windows = sys.platform.startswith('win') for enforce_safe_acc in ["1", "0"]: - # os.environ["MXNET_SAFE_ACCUMULATION"] = enforce_safe_acc - os.putenv("MXNET_SAFE_ACCUMULATION", enforce_safe_acc) - # raise ValueError("in python safe_acc is: {}".format(os.environ["MXNET_SAFE_ACCUMULATION"])) + if is_windows: + if enforce_safe_acc == "0": + break + enforce_safe_acc = "0" if "MXNET_SAFE_ACCUMULATION" not in os.environ else os.environ["MXNET_SAFE_ACCUMULATION"] + else: + os.environ["MXNET_SAFE_ACCUMULATION"] = enforce_safe_acc + print("in python safe_acc is: {}".format(os.environ["MXNET_SAFE_ACCUMULATION"])) for order in [1, 2]: for dtype in [np.float16, np.float32, np.float64]: for i in range(in_data_dim):