torch.no_grad() will avoid storing the intermediate tensors during validation and testing and will thus save memory.
model.eval() will change the behavior of some layers. E.g. it will disable dropout layers and use the running stats in batchnorm layers instead of the batch statistics.
If you didn’t use model.eval() during your training, the batchnorm statistics would have been updated (which might be a valid use case). However, this shouldn’t be used during evaluation or testing, especially if your batch size is small, as this could knock out the running stats.