Yiyan66 opened a new pull request #18660:
URL: https://github.com/apache/incubator-mxnet/pull/18660


   ## Description ##
   Delete the tests which may cause bug because of the following reasons:
   1. There are differences about type inference between NumPy and Deep Numpy 
when there's a input with shape ():
   If both inputs of np are of floating number types, the output is the more 
precise type, while onp will use the type of the matrix with higher dimension.
   ```python
   from mxnet import np, npx
   npx.set_np()
   import numpy as _np
   
   mx_test_x1 = np.random.uniform(-2, 2, (2,3)).astype(np.float32)
   mx_test_x2 = np.random.uniform(-2, 2, ()).astype(np.float16)
   
   np_out = _np.mod(mx_test_x1.asnumpy(), mx_test_x2.asnumpy()) # float16
   mx_out = np.mod(mx_test_x1, mx_test_x2) # float32
   ```
   
   2. As for logical ops, NumPy also has a weird behavior.
   ```python
   from mxnet import np, npx
   npx.set_np()
   import numpy as _np
   
   a = np.array([[1.441]], dtype = np.float16)
   b = np.array(1.4413278, dtype = np.float32)
   c = np.array([1.4413278], dtype = np.float32)
   
   np.greater(a,b), np.greater(a,c) # True True
   _np.greater(a.asnumpy(),b.asnumpy()), _np.greater(a.asnumpy(),c.asnumpy()) # 
False True
   np.less_equal(a,b), np.less_equal(a,c) # False False
   _np.less_equal(a.asnumpy(),b.asnumpy()), 
_np.less_equal(a.asnumpy(),c.asnumpy()) # True False
   ```
   
   ## Checklist ##
   ### Essentials ###
   Please feel free to remove inapplicable items for your PR.
   - [ ] The PR title starts with [MXNET-$JIRA_ID], where $JIRA_ID refers to 
the relevant [JIRA issue](https://issues.apache.org/jira/projects/MXNET/issues) 
created (except PRs with tiny changes)
   - [ ] Changes are complete (i.e. I finished coding on this PR)
   - [ ] All changes have test coverage:
   - Unit tests are added for small changes to verify correctness (e.g. adding 
a new operator)
   - Nightly tests are added for complicated/long-running ones (e.g. changing 
distributed kvstore)
   - Build tests will be added for build configuration changes (e.g. adding a 
new build option with NCCL)
   - [ ] Code is well-documented: 
   - For user-facing API changes, API doc string has been updated. 
   - For new C++ functions in header files, their functionalities and arguments 
are documented. 
   - For new examples, README.md is added to explain the what the example does, 
the source of the dataset, expected performance on test set and reference to 
the original paper if applicable
   - Check the API doc at 
https://mxnet-ci-doc.s3-accelerate.dualstack.amazonaws.com/PR-$PR_ID/$BUILD_ID/index.html
   - [ ] To the best of my knowledge, examples are either not affected by this 
change, or have been fixed to be compatible with this change
   
   ### Changes ###
   - [ ] Feature1, tests, (and when applicable, API doc)
   - [ ] Feature2, tests, (and when applicable, API doc)
   
   ## Comments ##
   - If this change is a backward incompatible change, why must this change be 
made.
   - Interesting edge cases to note here
   


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


Reply via email to