Skip to content

Conversation

@yf225
Copy link
Contributor

@yf225 yf225 commented Jul 16, 2019

We are planning to put up a deprecation warning for legacy autograd function in 1.2: #22922. This PR removes all usage of legacy function in PyTorch core and test suite, to prepare for the eventual removal of legacy function.

@yf225 yf225 requested a review from zou3519 July 16, 2019 20:45
@pytorchbot pytorchbot added module: autograd Related to torch.autograd, and the autograd engine in general module: nn Related to torch.nn labels Jul 16, 2019
@ezyang
Copy link
Contributor

ezyang commented Jul 16, 2019

You should kill uses NestedIOFunction too, as it is also in legacy style.

@yf225
Copy link
Contributor Author

yf225 commented Jul 17, 2019

I would like to scope out NestedIOFunction changes into another PR, as it's a user-visible class and needs more investigations in how to change it properly.

@yf225 yf225 force-pushed the remove_legacy_function_usage branch from 0f5b10d to d85b098 Compare July 17, 2019 17:45
rx, ry = NoneGradientFunction.apply(x, y)
rx.register_hook(hook)
ry.register_hook(hook)
sum(rx, ry).sum().backward()
Copy link
Contributor

Choose a reason for hiding this comment

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

Good!

Copy link
Contributor

@ezyang ezyang left a comment

Choose a reason for hiding this comment

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

Looks good, thank you. Note that this PR reduces our test coverage of legacy autograd functions, which means that we are less likely to notice breakages of legacy once we land it.

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.

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

@facebook-github-bot
Copy link
Contributor

@yf225 merged this pull request in 52bf380.

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: nn Related to torch.nn

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants