drivanov commented on a change in pull request #16218: Improving performance of 
argmax operator
URL: https://github.com/apache/incubator-mxnet/pull/16218#discussion_r328840504
 
 

 ##########
 File path: tests/python/unittest/test_operator.py
 ##########
 @@ -7535,6 +7535,15 @@ def test_softmax():
     check_smoothed_softmax_grad(default_context())
 
 
+def create_data(batch_size, num_labels, ctx=None, dtype=None, H=None, W=None):
 
 Review comment:
   Firts of all,
   ```
   def random_arrays(*shapes):
       """Generate some random numpy arrays."""
       arrays = [np.random.randn(*s).astype(default_dtype())
                 for s in shapes]
   ```
   generates only `np.arrays`'s and we need `mx.nd.array`'s here.
   Secondly, all elements of 'np.array' can only be of type `np.foat32`, and 
`dtype` is the input parameter of
   ```
   def create_data( ... dtype=None, ...):
   ```
   Third, the same approach is used to create data for 
   ```
   def test_softmax_output_normalization():
    . . .
           if multi_output:
               data = create_data(batch_size, num_labels, ctx=None, H=H, W=W)
               label_shape = (batch_size, H, W)
           else:
               data = create_data(batch_size, num_labels)
               label_shape = (batch_size, )
   ```
   I reused this one which, in my opinion is more versatile.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to