megengine.traced_module.TracedModule.train¶
- TracedModule.train(mode=True, recursive=True)¶
Sets training mode of all the modules within this module (including itself) to
mode
. This effectively sets thetraining
attributes of those modules tomode
, but only has effect on certain modules (e.g.BatchNorm2d
,Dropout
,Observer
)