Glossary: NLP with Transformers
inference_mode / no_grad
Also written: torch.inference_mode, torch.no_grad
PyTorch contexts that skip gradient tracking when you only predict. `inference_mode` is the stricter, faster version.
Glossary: NLP with Transformers
Also written: torch.inference_mode, torch.no_grad
PyTorch contexts that skip gradient tracking when you only predict. `inference_mode` is the stricter, faster version.