Додати до Chrome
✅ Перевірена відповідь на це питання доступна нижче. Наші рішення, перевірені спільнотою, допомагають краще зрозуміти матеріал.
What is the purpose of using the torch.no_grad() context manager or decorator in PyTorch?
torch.no_grad()
To automatically compute the gradients of a scalar loss with respect to all trainable parameters.
To build a static computational graph before executing the forward pass.
To zero out the gradients of the optimizer before a new backward pass is performed.
To enable hardware acceleration by moving tensors to the GPU or TPU.
To disable gradient tracking and reduce computational and memory overhead during inference or evaluation.
Отримайте необмежений доступ до відповідей на екзаменаційні питання - встановіть розширення Crowdly зараз!