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

Fix handling of leaf Variables in autograd #391

Merged
merged 3 commits into from Jan 2, 2017
Merged

Fix handling of leaf Variables in autograd #391

merged 3 commits into from Jan 2, 2017

Conversation

apaszke
Copy link
Contributor

@apaszke apaszke commented Jan 2, 2017

TODO: add docs about in-place ops on variables and their consequences

@@ -363,20 +363,20 @@ def test_unused_output_gpu(self):
def test_no_grad(self):
x = Variable(torch.randn(10, 10), requires_grad=True)
y = x + 2
y = y.no_grad()
y = y.detach()

This comment was marked as off-topic.

This comment was marked as off-topic.

@soumith soumith merged commit 1c6fe58 into master Jan 2, 2017
@soumith soumith deleted the autograd_leaf branch January 5, 2017 04:21
KyleCZH pushed a commit to KyleCZH/pytorch that referenced this pull request Sep 20, 2021
Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
eellison pushed a commit to eellison/pytorch that referenced this pull request Jun 29, 2022
* Support for lazy modules with test

Added fixes to support lazy modules in torchdynamo. The main issue that needed to be addressed is that LazyModules register some hooks which are run when a module is called. Torchdynamo typically calls the forward method instead of __call__ so these hooks were never run. In the case of LazyModules we now run and trace the __call__ method, and allow the original module to be mutated. In the future, we could do this for all modules, but there were cases where torchdynamo does not yet support functionality used in all hooks.
hubertlu-tw pushed a commit to hubertlu-tw/pytorch that referenced this pull request Nov 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants