ParametrizationList¶
-
class
torch.nn.utils.parametrize.
ParametrizationList
(modules, original)[source]¶ A sequential container that holds and manages the
original
parameter or buffer of a parametrizedtorch.nn.Module
. It is the type ofmodule.parametrizations[tensor_name]
whenmodule[tensor_name]
has been parametrized withregister_parametrization()
.Note
This class is used internally by
register_parametrization()
. It is documented here for completeness. It should not be instantiated by the user.- Parameters
-
set_original_
(value)[source]¶ This method is called when assigning to a parametrized tensor.
It calls the methods
right_inverse
(seeregister_parametrization()
) of the parametrizations in the inverse order that they have been registered. Then, it assigns the result toself.original
.- Parameters
value (Tensor) – Value to which initialize the module
- Raises
RuntimeError – if any of the parametrizations do not implement a
right_inverse
method