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

 ##########
 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:
   Also, we'd better add a dtype flag to the function, which is None by default 
and set it to default_dtype() if it's None.

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


With regards,
Apache Git Services

Reply via email to