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/09/19 08:39:25 UTC

[GitHub] [incubator-mxnet] hanke580 opened a new pull request #19187: [Numpy] Tensordot Gradient Fixed

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


   * Fix tensordot
   
   ## Description ##
   Operator tensordot running wrong when the gradient is attached with "add" like
   
   ~~~
   from mxnet import np, npx
   npx.set_np()
   npx.random.seed(123)
   from mxnet import autograd
   
   a = np.random.normal(0,1,(3,2)).astype(np.float32)
   b = np.random.normal(0,1,(2)).astype(np.float32)
   a.attach_grad("add")
   b.attach_grad()
   
   # the initialization of a won't succeed
   a.grad[:] = np.ones((3,2)).astype(np.float32)
   a.grad
   
   with autograd.record():
   	m = np.tensordot(a,b,[[1],[0]])
   	m.backward()
   
   ~~~
   Also, if you redefine `m = np.random.normal(0,1,(3,2)).astype(np.float32)`, m will have the gradient of a.
   
   Now the issue has been fixed and all tests covered.
   
   
   
   ## Checklist ##
   ### Essentials ###
   - [ ] PR's title starts with a category (e.g. [BUGFIX], [MODEL], [TUTORIAL], [FEATURE], [DOC], etc)
   - [ ] Changes are complete (i.e. I finished coding on this PR)
   - [ ] All changes have test coverage
   - [ ] Code is well-documented
   
   ### 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:
users@infra.apache.org



[GitHub] [incubator-mxnet] yzhliu commented on pull request #19187: [Numpy] Tensordot Gradient Fixed

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






----------------------------------------------------------------
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] hanke580 removed a comment on pull request #19187: [Numpy] Tensordot Gradient Fixed

Posted by GitBox <gi...@apache.org>.
hanke580 removed a comment on pull request #19187:
URL: https://github.com/apache/incubator-mxnet/pull/19187#issuecomment-700835580


   Jenkins CI successfully triggered : [centos-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] yzhliu merged pull request #19187: [Numpy] Tensordot Gradient Fixed

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


   


----------------------------------------------------------------
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] sxjscience commented on pull request #19187: [Numpy] Tensordot Gradient Fixed

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


   Thanks @hanke580 @yzhliu ! I've also updated my example in the issue.


----------------------------------------------------------------
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] hanke580 commented on pull request #19187: [Numpy] Tensordot Gradient Fixed

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


   Jenkins CI successfully triggered : [centos-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] hanke580 commented on pull request #19187: [Numpy] Tensordot Gradient Fixed

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


    @mxnet-bot run ci [centos-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] hanke580 commented on pull request #19187: [Numpy] Tensordot Gradient Fixed

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


   @mxnet-bot run ci [centos-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 #19187: [Numpy] Tensordot Gradient Fixed

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


   Jenkins CI successfully triggered : [centos-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 #19187: [Numpy] Tensordot Gradient Fixed

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


   Jenkins CI successfully triggered : [centos-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 #19187: [Numpy] Tensordot Gradient Fixed

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


   Hey @hanke580 , 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**: [clang, edge, centos-cpu, windows-cpu, windows-gpu, unix-cpu, website, unix-gpu, sanity, miscellaneous, centos-gpu]
   *** 
   _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] sxjscience edited a comment on pull request #19187: [Numpy] Tensordot Gradient Fixed

Posted by GitBox <gi...@apache.org>.
sxjscience edited a comment on pull request #19187:
URL: https://github.com/apache/incubator-mxnet/pull/19187#issuecomment-701126388


   Thanks @hanke580 @yzhliu ! I've also updated my example in the issue to use `a[()]` instead of `a[:]`


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