Skip to content

Commit

Permalink
Fix unexpected inference_mode interaction with torch.autograd.functio…
Browse files Browse the repository at this point in the history
…nal.jacobian (pytorch#130307)

Fixes pytorch#128264

Pull Request resolved: pytorch#130307
Approved by: https://github.com/soulitzer
  • Loading branch information
tianyeeT authored and pytorchmergebot committed Aug 25, 2024
1 parent dc1959e commit 7af38eb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/source/notes/autograd.rst
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,9 @@ This better runtime comes with a drawback: tensors created in inference mode
will not be able to be used in computations to be recorded by autograd after
exiting inference mode.

Enable inference mode when you are performing computations that don’t need
to be recorded in the backward graph, AND you don’t plan on using the tensors
created in inference mode in any computation that is to be recorded by autograd later.
Enable inference mode when you are performing computations that do not have
interactions with autograd, AND you don’t plan on using the tensors created
in inference mode in any computation that is to be recorded by autograd later.

It is recommended that you try out inference mode in the parts of your code
that do not require autograd tracking (e.g., data processing and model evaluation).
Expand Down

0 comments on commit 7af38eb

Please sign in to comment.