79488123

Date: 2025-03-06 02:49:48
Score: 1
Natty:
Report link

I'd like to provide a rule of thumb based on Satya Prakash Dash's answer:

  1. Prefer torch.inference_mode() for pure inference scenarios which gives you maximum performance.

  2. Use torch.no_grad() when working with custom autograd functions or dealing with older code.

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Ethkuil