It will not be both train and inference.
When use model.train(), the self.training become True, it will keep the self.training value until you use model.eval()
then you use model.eval(), the self.training become False