Yes, that’s right. All modules are in training mode by default after initialization.
Sorry, I’ve overlooked the last line of code.
For inference, I would rather call net.eval(), which will set all modules recursively to evaluation mode.