(model: Module, dtype: torch.dtype)
| 1015 | |
| 1016 | @staticmethod |
| 1017 | def __check_params(model: Module, dtype: torch.dtype) -> None: |
| 1018 | return |
| 1019 | if not all(param.dtype == dtype for param in model.parameters()) and dist.get_rank() == 0: |
| 1020 | raise ValueError(f"{dtype} is enabled but the following parameters have dtype that is " |
| 1021 | f"not {dtype}: " |
| 1022 | f"{[(n, p.dtype) for n, p in model.named_parameters() if p.dtype != dtype]}") |
| 1023 | |
| 1024 | def _set_client_model(self, model): |
| 1025 | # register client model in _modules so that nn.module methods work correctly |
no test coverage detected