MCPcopy Create free account
hub / github.com/MiniMax-AI/VTP / has_batchnorms

Function has_batchnorms

vtp/models/utils/utils.py:113–118  ·  view source on GitHub ↗
(model: nn.Module)

Source from the content-addressed store, hash-verified

111
112
113def has_batchnorms(model: nn.Module) -> bool:
114 bn_types = (nn.BatchNorm1d, nn.BatchNorm2d, nn.BatchNorm3d, nn.SyncBatchNorm)
115 for _, module in model.named_modules():
116 if isinstance(module, bn_types):
117 return True
118 return False

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected