validate_expected_param_dtype¶
- torchtune.utils.validate_expected_param_dtype(named_params: Iterable[Tuple[str, Parameter]], dtype: dtype) None [source]¶
Validates that all input parameters have the expected dtype.
- Parameters:
named_params (Iterable[Tuple[str,
torch.nn.Parameter
]]) – Iterable of named parameters.dtype (
torch.dtype
) – Expected dtype.
- Raises:
ValueError – If any parameter has a different dtype than dtype.