Is it necessary to use with torch.no_grad()
when performing inference with CTranslate2.Transformer
? Does CTranslate2 already handle the disabling of gradient calculations during inference, or would adding torch.no_grad()
offer any benefit?
Is it necessary to use with torch.no_grad()
when performing inference with CTranslate2.Transformer
? Does CTranslate2 already handle the disabling of gradient calculations during inference, or would adding torch.no_grad()
offer any benefit?