Inference Mode — PyTorch master documentation
pytorch.org › cppdocs › notesInferenceMode can be enabled for a given block of code. Inside InferenceMode all newly allocated (non-view) tensors are marked as inference tensors. Inference tensors: do not have a version counter so an error will be raised if you try to read their version (e.g., because you saved this tensor for backward). are immutable outside InferenceMode.
torch.is_inference_mode_enabled — PyTorch 1.11.0 documentation
pytorch.org › torchLearn about PyTorch’s features and capabilities. Community. Join the PyTorch developer community to contribute, learn, and get your questions answered. Developer Resources. Find resources and get questions answered. Forums. A place to discuss PyTorch code, issues, install, research. Models (Beta) Discover, publish, and reuse pre-trained models