On this page
torch.nn.utils.parametrize.remove_parametrizations
torch.nn.utils.parametrize.remove_parametrizations(module, tensor_name, leave_parametrized=True)[source]-
Removes the parametrizations on a tensor in a module.
- If
leave_parametrized=True,module[tensor_name]will be set to its current output. In this case, the parametrization shall not change thedtypeof the tensor. - If
leave_parametrized=False,module[tensor_name]will be set to the unparametrised tensor inmodule.parametrizations[tensor_name].original. This is only possible when the parametrization depends on just one tensor.
- Parameters
- Returns
-
module
- Return type
- Raises
-
- ValueError – if
module[tensor_name]is not parametrized - ValueError – if
leave_parametrized=Falseand the parametrization depends on several tensors
- ValueError – if
- If
© 2024, PyTorch Contributors
PyTorch has a BSD-style license, as found in the LICENSE file.
https://pytorch.org/docs/2.1/generated/torch.nn.utils.parametrize.remove_parametrizations.html