There is two parts to this.


training_step is about training, so it seems natural that the model is in training mode,
Lightning automatically sets the model to training for training_step and to eval for validation.

Best regards
Thomas