wkcn commented on a change in pull request #18644:
URL: https://github.com/apache/incubator-mxnet/pull/18644#discussion_r448320053



##########
File path: tests/python/unittest/test_gluon.py
##########
@@ -665,6 +665,34 @@ def transpose(shape):
         assert (layer(x).shape==ceil_out_shape)
 
 
+@with_seed()
+@pytest.mark.parametrize('cudnn_off', [True, False])
+@pytest.mark.parametrize('variable', ['running_var', 'running_mean'])
+def test_batchnorm_backward_synchronization(cudnn_off, variable):
+    """
+    Tests if synchronization of BatchNorm running variables is done correctly.
+    If not, the test sometimes fails - depending on the timing.
+    """
+    ctx = mx.cpu() if cudnn_off else mx.gpu()

Review comment:
       There seems to no command line to specify the context.
   The default context is CPU.
   We can create a python file, like 
https://github.com/apache/incubator-mxnet/blob/master/tests/python/gpu/test_gluon_gpu.py
   
   '''
   import mxnet ad mx
   from some_test_file import *
   set_default_context(mx.gpu(0))
   '''
   It will switch to gpu context.




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to