Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

[BUGFIX] autograd.grad #19275

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

[BUGFIX] autograd.grad #19275

wants to merge 1 commit into from

Conversation

yifeim
Copy link
Contributor

@yifeim yifeim commented Oct 2, 2020

Description

When the input is a single variable, autograd is supposed to return a single variable. However, it returns a list. Upon further investigation, I realized that the input variable is overwritten as a list without getting converted back. This fix separates out the flag to convert the output back to variable.

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

Comments

  • Potentially backward incompatible but people who use it should be able to notice the inconsistency and avoid this particular use case.
  • Edge case: what if the input is neither a variable nor a list? Proper input validation should be done.

previous behavior: input variable output list
intended behavior: input variable output variable
@yifeim yifeim requested a review from szha as a code owner October 2, 2020 04:49
@mxnet-bot
Copy link

Hey @yifeim , 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: [miscellaneous, windows-cpu, edge, windows-gpu, unix-cpu, unix-gpu, sanity, website, centos-cpu, centos-gpu, 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.

@xidulu
Copy link
Contributor

xidulu commented Oct 3, 2020

Hi @yifeim , thanks for your contribution
Could you add some descriptions and test cases about this patch? (e.g. Why is this a bug, how does your patch fix the problem)

@yifeim
Copy link
Contributor Author

yifeim commented Oct 12, 2020

Hi @yifeim , thanks for your contribution
Could you add some descriptions and test cases about this patch? (e.g. Why is this a bug, how does your patch fix the problem)

Done. Thanks for the comments.

@mseth10 mseth10 added pr-work-in-progress PR is still work in progress pr-awaiting-testing PR is reviewed and waiting CI build and test and removed pr-work-in-progress PR is still work in progress pr-awaiting-testing PR is reviewed and waiting CI build and test labels Mar 14, 2022
@mseth10 mseth10 added pr-awaiting-testing PR is reviewed and waiting CI build and test pr-work-in-progress PR is still work in progress and removed pr-work-in-progress PR is still work in progress pr-awaiting-testing PR is reviewed and waiting CI build and test labels Mar 25, 2022
@mseth10 mseth10 added pr-awaiting-testing PR is reviewed and waiting CI build and test pr-work-in-progress PR is still work in progress and removed pr-work-in-progress PR is still work in progress pr-awaiting-testing PR is reviewed and waiting CI build and test labels Apr 2, 2022
@mseth10 mseth10 added pr-awaiting-testing PR is reviewed and waiting CI build and test pr-work-in-progress PR is still work in progress and removed pr-work-in-progress PR is still work in progress pr-awaiting-testing PR is reviewed and waiting CI build and test labels Apr 16, 2022
@mseth10 mseth10 added pr-awaiting-testing PR is reviewed and waiting CI build and test pr-work-in-progress PR is still work in progress and removed pr-work-in-progress PR is still work in progress pr-awaiting-testing PR is reviewed and waiting CI build and test labels Apr 27, 2022
@mseth10 mseth10 added pr-awaiting-testing PR is reviewed and waiting CI build and test and removed pr-work-in-progress PR is still work in progress labels Nov 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pr-awaiting-testing PR is reviewed and waiting CI build and test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants