Comments (3)
I'm not sure if this is the intended behavior
This is expected behavior. Computing the jacobian with torch.autograd.functional.jacobian
does not work with inference mode because it needs to record computation to the autograd graph underneath.
perhaps we can add a line in the documentation of inference mode about this behavior?
From the docs there is:
InferenceMode is a new context manager analogous to no_grad to be used when you are certain your operations will have no interactions with autograd
From https://pytorch.org/docs/stable/generated/torch.autograd.grad_mode.inference_mode.html
Does this line make things clearer?
from pytorch.
I see, yes that certainly makes things clearer. Maybe we can add something like that to the documentation at https://pytorch.org/docs/stable/notes/autograd.html#inference-mode? So maybe instead of
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.
we can write
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.
from pytorch.
Sounds OK to me, thanks for the suggestion. Happy to accept a PR with that change.
from pytorch.
Related Issues (20)
- DISABLED test_segfault (__main__.TestDataLoader) HOT 3
- aot_export_module produces unserializable GraphModules
- Dynamo graph breaks when passing a constant value to a nn module initialized within a function
- MaskedTensor do not support _is_any_true`
- internal asset failure HOT 1
- post grad batch linear fusion performs unsafe optimization when inlining nn modules HOT 3
- NotImplementedError: Could not run 'quantized::linear' with arguments from the 'CPU' backend. 'quantized::linear' is only available for these backends: [QuantizedCPU, QuantizedCUDA, BackendSelect, Python,....] HOT 1
- TorchScript JIT UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xe0 in position 0: unexpected end of data
- Lintrunner results inconsistent HOT 1
- make AutocastPrivateUse1 have a default implement
- jacrev and jacfwd yield different results if one uses torch.no_grad blocks in module HOT 4
- Retry on CUBLAS_STATUS_ALLOC_FAILED HOT 1
- The running will become slower and slower with epoch continuing, but without error when the mlpmixer model is used HOT 2
- custom torch.autograd.Function with jvp method outputs error without explicit torch._dynamo import HOT 2
- [BUG] Circular dependency `torch.nn.parameter` -> `torch.nn` -> `torch.autograd` -> `torch._C._autograd_init()` -> `torch.nn.parameter`
- torch.onnx.export() 1.16 with pytorch 2.2.1 produces invalid model
- Saved variable packing unpacking incorrect aliases version counter
- CUDA causes ipykernel failure HOT 1
- Be able to dynamically disable a kernel for a custom op
- [ONNX] Enable op tests to run with torch.export.export pre_dispatch
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pytorch.