You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2019/08/15 08:16:32 UTC

[GitHub] [incubator-mxnet] DickJC123 commented on a change in pull request #15882: Move Windows CI build to a 64-bit toolchain to fix 'out of heap space'.

DickJC123 commented on a change in pull request #15882: Move Windows CI build to a 64-bit toolchain to fix 'out of heap space'.
URL: https://github.com/apache/incubator-mxnet/pull/15882#discussion_r314213660
 
 

 ##########
 File path: tests/python/unittest/test_random.py
 ##########
 @@ -893,14 +893,15 @@ def compute_expected_prob():
 def test_shuffle():
     def check_first_axis_shuffle(arr):
         stride = int(arr.size / arr.shape[0])
-        column0 = arr.reshape((arr.size,))[::stride].sort()
+        column0 = arr.reshape((arr.size,))[::stride]
         seq = mx.nd.arange(0, arr.size - stride + 1, stride, ctx=arr.context)
-        assert (column0 == seq).prod() == 1
-        for i in range(arr.shape[0]):
-            subarr = arr[i].reshape((arr[i].size,))
-            start = subarr[0].asscalar()
-            seq = mx.nd.arange(start, start + stride, ctx=arr.context)
-            assert (subarr == seq).prod() == 1
+        assert (column0.sort() == seq).prod() == 1
 
 Review comment:
   There are no random shapes in test_shuffle so its runtime, even give the sort, should be fairly consistent.  My only explanation for the runtime variation is that maybe there's multiple cpu runners on the same machine.  Looking for confirmation from @marcoabreu.
   
   Moving the sort was just a style preference, not performance driven.  The biggest runtime savings came from introducing the `if stride > 1:` clause and avoiding needless work for the last big 1D test input.  The rest was just some further perf polishing.
   
   I keep stumbling on flakey tests with this PR, so my last commit is fixing laop_6.  A bit of bad luck I would say.

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


With regards,
Apache Git Services