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/10/03 20:42:25 UTC

[GitHub] [incubator-mxnet] shenfei opened a new pull request #19285: [Numpy] Support `mxnet.numpy.ndarray.diagonal()`

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


   ## Description ##
   Support `mxnet.numpy.ndarray.diagonal()` and fix https://github.com/apache/incubator-mxnet/issues/18301
   
   ## Checklist ##
   ### Essentials ###
   - [x] PR's title starts with a category (e.g. [BUGFIX], [MODEL], [TUTORIAL], [FEATURE], [DOC], etc)
   - [x] Changes are complete (i.e. I finished coding on this PR)
   - [x] All changes have test coverage
   - [x] Code is well-documented
   
   ### Changes ###
   - `mxnet.numpy.ndarray.diagonal()`
   - `unittest/test_numpy_op.py::test_np_diagonal`
   
   ## Comments ##
   This is my first PR for MXNet, so I’m not sure if my unit test’s change is correct.
   


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



[GitHub] [incubator-mxnet] xidulu commented on pull request #19285: [Numpy] Support `mxnet.numpy.ndarray.diagonal()`

Posted by GitBox <gi...@apache.org>.
xidulu commented on pull request #19285:
URL: https://github.com/apache/incubator-mxnet/pull/19285#issuecomment-703245547


   @mxnet-bot run ci [windows-gpu]


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



[GitHub] [incubator-mxnet] shenfei commented on pull request #19285: [Numpy] Support `mxnet.numpy.ndarray.diagonal()`

Posted by GitBox <gi...@apache.org>.
shenfei commented on pull request #19285:
URL: https://github.com/apache/incubator-mxnet/pull/19285#issuecomment-703265937


   @mxnet-bot run ci [windows-gpu]


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



[GitHub] [incubator-mxnet] mxnet-bot commented on pull request #19285: [Numpy] Support `mxnet.numpy.ndarray.diagonal()`

Posted by GitBox <gi...@apache.org>.
mxnet-bot commented on pull request #19285:
URL: https://github.com/apache/incubator-mxnet/pull/19285#issuecomment-703162226


   Hey @shenfei , Thanks for submitting the PR 
   All tests are already queued to run once. If tests fail, you can trigger one or more tests again with the following commands: 
   - To trigger all jobs: @mxnet-bot run ci [all] 
   - To trigger specific jobs: @mxnet-bot run ci [job1, job2] 
   *** 
   **CI supported jobs**: [windows-cpu, centos-cpu, unix-gpu, sanity, windows-gpu, website, edge, centos-gpu, miscellaneous, unix-cpu, clang]
   *** 
   _Note_: 
    Only following 3 categories can trigger CI :PR Author, MXNet Committer, Jenkins Admin. 
   All CI tests must pass before the PR can be merged. 
   


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



[GitHub] [incubator-mxnet] mxnet-bot commented on pull request #19285: [Numpy] Support `mxnet.numpy.ndarray.diagonal()`

Posted by GitBox <gi...@apache.org>.
mxnet-bot commented on pull request #19285:
URL: https://github.com/apache/incubator-mxnet/pull/19285#issuecomment-703265949


   Jenkins CI successfully triggered : [windows-gpu]


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



[GitHub] [incubator-mxnet] shenfei commented on a change in pull request #19285: [Numpy] Support `mxnet.numpy.ndarray.diagonal()`

Posted by GitBox <gi...@apache.org>.
shenfei commented on a change in pull request #19285:
URL: https://github.com/apache/incubator-mxnet/pull/19285#discussion_r499225397



##########
File path: tests/python/unittest/test_numpy_op.py
##########
@@ -9244,21 +9243,24 @@ def hybrid_forward(self, F, a):
 
     rtol = 1e-2 if dtype == np.float16 else 1e-3
     atol = 1e-4 if dtype == np.float16 else 1e-5
-    shape = config[0]
-    axis = config[1]
-    axis1 = axis[0]
-    axis2 = axis[1]
+    shape, (axis1, axis2) = config
     x = np.random.uniform(-5.0, 5.0, size=shape).astype(dtype)
     x.attach_grad()
     test_diagonal = TestDiagonal(k, axis1, axis2)

Review comment:
       @xidulu Thanks for the review. I’ve added two new commits https://github.com/apache/incubator-mxnet/pull/19285/commits/c9c8aa7df44c7936c4e54c1716ac1d5cac6c2f4a and https://github.com/apache/incubator-mxnet/pull/19285/commits/8ae59cefad67fa1eea1cc5a6bc0033dc6faa570a to cover the hybridize case.




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



[GitHub] [incubator-mxnet] mxnet-bot commented on pull request #19285: [Numpy] Support `mxnet.numpy.ndarray.diagonal()`

Posted by GitBox <gi...@apache.org>.
mxnet-bot commented on pull request #19285:
URL: https://github.com/apache/incubator-mxnet/pull/19285#issuecomment-703245558


   Jenkins CI successfully triggered : [windows-gpu]


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



[GitHub] [incubator-mxnet] xidulu merged pull request #19285: [Numpy] Support `mxnet.numpy.ndarray.diagonal()`

Posted by GitBox <gi...@apache.org>.
xidulu merged pull request #19285:
URL: https://github.com/apache/incubator-mxnet/pull/19285


   


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



[GitHub] [incubator-mxnet] xidulu commented on pull request #19285: [Numpy] Support `mxnet.numpy.ndarray.diagonal()`

Posted by GitBox <gi...@apache.org>.
xidulu commented on pull request #19285:
URL: https://github.com/apache/incubator-mxnet/pull/19285#issuecomment-703373037


   @mxnet-bot run ci [edge]


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



[GitHub] [incubator-mxnet] mxnet-bot commented on pull request #19285: [Numpy] Support `mxnet.numpy.ndarray.diagonal()`

Posted by GitBox <gi...@apache.org>.
mxnet-bot commented on pull request #19285:
URL: https://github.com/apache/incubator-mxnet/pull/19285#issuecomment-703373069


   Jenkins CI successfully triggered : [edge]


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



[GitHub] [incubator-mxnet] xidulu commented on a change in pull request #19285: [Numpy] Support `mxnet.numpy.ndarray.diagonal()`

Posted by GitBox <gi...@apache.org>.
xidulu commented on a change in pull request #19285:
URL: https://github.com/apache/incubator-mxnet/pull/19285#discussion_r499201262



##########
File path: tests/python/unittest/test_numpy_op.py
##########
@@ -9244,21 +9243,24 @@ def hybrid_forward(self, F, a):
 
     rtol = 1e-2 if dtype == np.float16 else 1e-3
     atol = 1e-4 if dtype == np.float16 else 1e-5
-    shape = config[0]
-    axis = config[1]
-    axis1 = axis[0]
-    axis2 = axis[1]
+    shape, (axis1, axis2) = config
     x = np.random.uniform(-5.0, 5.0, size=shape).astype(dtype)
     x.attach_grad()
     test_diagonal = TestDiagonal(k, axis1, axis2)

Review comment:
       The test case you modified did not cover the hybridize case (i.e. the symbol mode), so I suggest changing the function call at https://github.com/apache/incubator-mxnet/blob/master/tests/python/unittest/test_numpy_op.py#L9243 as well to test if your patch is fully compatible with hybrid block.




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