The scaler is not necessary during evaluation, as you won’t call backward in this step and thus there are not gradients to scale.
You can still use autocast and also wrap the code in a with torch.no_grad() block to save more memory.