Skip to content
masterclass Buddy

PyTorch · Method

model.eval

model.eval() switches a TorchVision model to evaluation mode. Use it before inference so layers with different training and evaluation behavior use their inference behavior.

Last updated

Syntax

model.eval()

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • model.train()
  • weights.transforms()
  • ResNet50_Weights
  • resnet50

Source: Models and pre-trained weights — Torchvision stable documentation. Checked 2026-11-03.