Zha0q1 commented on issue #20265: URL: https://github.com/apache/incubator-mxnet/issues/20265#issuecomment-843587885
Here is the source code of the second test case https://github.com/apache/incubator-mxnet/blob/master/tests/python/unittest/test_operator.py#L1750-L1829 ```python @with_seed() def test_convolution_independent_gradients(): ctx = mx.cpu() atol = 1.0e-3 rtol = 1.0e-3 reqs = ["null", "write", "add"] var_names = ["x", "w", "b"] dims = [2] num_bases = [1, 8] kernel_xs = [3, 5] stride_xs = [1, 2] pad_xs = [0, 1] in_sizes = [7, 32] no_biases = [True, False] ``` This test will only fail when `dim=2`. However, if at the same time we set `reqs = ["write", "add"]` rather than `reqs = ["null", "write", "add"]`, the test will also run fine. failure: ``` ====================================================================== FAIL: test_operator.test_convolution_independent_gradients ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/ubuntu/.local/lib/python3.6/site-packages/nose/case.py", line 198, in runTest self.test(*self.arg) File "/home/ubuntu/incubator-mxnet/tests/python/unittest/common.py", line 218, in test_new orig_test(*args, **kwargs) File "/home/ubuntu/incubator-mxnet/tests/python/unittest/test_operator.py", line 2242, in test_convolution_independent_gradients exe2.outputs[0].asnumpy(), rtol=rtol, atol=atol) File "/home/ubuntu/.local/lib/python3.6/site-packages/numpy/testing/_private/utils.py", line 1528, in assert_allclose verbose=verbose, header=header, equal_nan=equal_nan) File "/home/ubuntu/.local/lib/python3.6/site-packages/numpy/testing/_private/utils.py", line 840, in assert_array_compare raise AssertionError(msg) AssertionError: Not equal to tolerance rtol=0.001, atol=0.001 Mismatched elements: 50 / 50 (100%) Max absolute difference: 7.249808 Max relative difference: 37.313366 x: array([[[[-3.723791, 4.639688, -0.084135, 1.286607, 5.300301], [ 2.492521, -4.99145 , -2.470633, 0.893196, -1.087579], [-0.640068, -1.888586, -1.97117 , -0.046645, -2.467756],... y: array([[[[ 2.861494, -1.560436, 2.371599, 6.006711, 1.072686], [-3.419539, -2.064956, 2.353943, 0.867886, 0.583497], [-3.662952, 0.055854, -2.707001, -3.451663, 2.091815],... -------------------- >> begin captured logging << -------------------- ``` command to run test: ``` nosetests-3.4 --with-coverage --cover-inclusive --cover-xml --cover-branches --cover-package=mxnet --with-timer --timer-ok 1 --timer-warning 15 --timer-filter warning,error --with-xunit --xunit-file nosetests_unittest.xml --verbose tests/python/unittest/test_operator.py:test_convolution_independent_gradients ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
