It shouldn't happen in the test phase, because at this time, the derivation is no longer needed. The inspection found that there is less time in the model calculation.
with torch.no_grad:
That should:
with torch.no_grad():
pred = model(input)