Shortcuts

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.

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources