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/16 15:14:56 UTC

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

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

 ##########
 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:
   @sxjscience Will do that.
   
   @larroy Agreed even I don't like that. However note that `random_arrays` in `test_utils.py` has that. I wanted `random_uniform_arrays` to be a drop-in replacement for `random_arrays` if and where necessary. But I guess it makes sense to not worry about it.
   https://github.com/apache/incubator-mxnet/blob/04c3eec3e8ea793614244e18a89c6b3a13f12d6a/python/mxnet/test_utils.py#L95-L102

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