MCPcopy Create free account
hub / github.com/alinlab/SelfPatch / has_batchnorms

Function has_batchnorms

utils.py:626–631  ·  view source on GitHub ↗
(model)

Source from the content-addressed store, hash-verified

624
625
626def has_batchnorms(model):
627 bn_types = (nn.BatchNorm1d, nn.BatchNorm2d, nn.BatchNorm3d, nn.SyncBatchNorm)
628 for name, module in model.named_modules():
629 if isinstance(module, bn_types):
630 return True
631 return False
632
633
634class PCA():

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected