(model: nn.Module)
| 111 | |
| 112 | |
| 113 | def 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 |
nothing calls this directly
no outgoing calls
no test coverage detected