Where there's no .train() method in this Pytorch official tutorial?

So, I just learned Pytorch and they say that you must put the NN in train mode by .train() method, then while inferencing .eval() mode. I’m reading this tutorial and there’s no .train() at all. Why is that?

https://pytorch.org/tutorials/beginner/blitz/cifar10_tutorial.html#sphx-glr-beginner-blitz-cifar10-tutorial-py

After initializing a model (or in fact an nn.Module), it will be in training mode by default, so you don’t need to call it. :wink:

1 Like