Related to: Machine Learning
torch.no_gard()
- backward를 사용하지 않을 때(inference 시점) 메모리 소비를 줄임
- 모델 내 tensor 중 requred_grad = True인 경우에도 required_grad=False처리하여 계산
참조
https://pytorch.org/docs/stable/generated/torch.no_grad.html
Related to: Machine Learning
https://pytorch.org/docs/stable/generated/torch.no_grad.html