Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't save self in index backward #25594

Closed
wants to merge 1 commit into from

Conversation

zou3519
Copy link
Contributor

@zou3519 zou3519 commented Sep 3, 2019

self isn't necessary for index backward, we only need the shape of
self. Changing derivatives.yaml to use zeros_like(self) triggers a
codepath in the codegen to only save the shape.

Fixes #24853.

Test Plan

`self` isn't necessary for `index` backward, we only need the shape of
`self`. Changing derivatives.yaml to use `zeros_like(self)` triggers a
codepath in the codegen to only save the shape.

Fixes pytorch#24853.

Test Plan
- I added a new test that is adapted from the code in
pytorch#24853. I'm not sure what a
more minimal example would look like because the bug is hard to trigger
because of how autograd handles differential views.
@zou3519 zou3519 requested review from ezyang and yf225 September 3, 2019 18:17
@pytorchbot pytorchbot added module: autograd Related to torch.autograd, and the autograd engine in general module: internals Related to internal abstractions in c10 and ATen labels Sep 3, 2019
Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zou3519 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@zou3519 merged this pull request in 8edf149.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Merged module: autograd Related to torch.autograd, and the autograd engine in general module: internals Related to internal abstractions in c10 and ATen
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Run time error with backward() after upgrading to pytorch 1.2.0
6 participants