mmengine.model.revert_sync_batchnorm¶
- mmengine.model.revert_sync_batchnorm(module)[源代码]¶
Helper function to convert all SyncBatchNorm (SyncBN) and mmcv.ops.sync_bn.SyncBatchNorm`(MMSyncBN) layers in the model to `BatchNormXd layers.
Adapted from @kapily’s work: (https://github.com/pytorch/pytorch/issues/41081#issuecomment-783961547)
- 参数:
module (nn.Module) – The module containing SyncBatchNorm layers.
- 返回:
The converted module with BatchNormXd layers.
- 返回类型:
module_output