W3cubDocs

/PyTorch 2.9

torch.nn.utils.parametrize.is_parametrized

torch.nn.utils.parametrize.is_parametrized(module, tensor_name=None) [source]

Determine if a module has a parametrization.

Parameters
  • module (nn.Module) – module to query
  • tensor_name (str, optional) – name of the parameter in the module Default: None
Returns

True if module has a parametrization for the parameter named tensor_name, or if it has any parametrization when tensor_name is None; otherwise False

Return type

bool

© 2025, PyTorch Contributors
PyTorch has a BSD-style license, as found in the LICENSE file.
https://docs.pytorch.org/docs/2.9/generated/torch.nn.utils.parametrize.is_parametrized.html