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 2020/01/15 23:00:24 UTC

[GitHub] [incubator-mxnet] larroy commented on a change in pull request #17325: Fix Flaky Test Higher Order Grad

larroy commented on a change in pull request #17325: Fix Flaky Test Higher Order Grad
URL: https://github.com/apache/incubator-mxnet/pull/17325#discussion_r367152446
 
 

 ##########
 File path: python/mxnet/test_utils.py
 ##########
 @@ -102,6 +102,16 @@ def random_arrays(*shapes):
     return arrays
 
 
+def random_uniform_arrays(*shapes, low=0.0, high=1.0):
+    """Generate some random numpy arrays."""
+    arrays = [np.array(np.random.uniform(low, high), dtype=default_dtype())
+              if len(s) == 0 else np.random.uniform(low, high, size=s).astype(default_dtype())
+              for s in shapes]
 
 Review comment:
   I don't like to return different types based on inputs, the function should just return a list of arrays. other than that PR looks fine and approach is good. thanks for the PR.

----------------------------------------------------------------
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