Description
Add Link
https://pytorch.org/tutorials/intermediate/parametrizations.html
Describe the bug
The code sample has no bug but the example output is wrong. The "weight" from after remove_parametrizations(layer, "weight", leave_parametrized=False)
should be same as that from "Before" but instead it is shown as that of"Parametrized". I was confused until I tried out the code. It does change it back to the weights from "Before".
Before:
Linear(in_features=3, out_features=3, bias=True)
Parameter containing:
tensor([[-0.3447, -0.3777, 0.5038],
[ 0.2042, 0.0153, 0.0781],
[-0.4640, -0.1928, 0.5558]], requires_grad=True)
Parametrized:
ParametrizedLinear(
in_features=3, out_features=3, bias=True
(parametrizations): ModuleDict(
(weight): ParametrizationList(
(0): Skew()
)
)
)
tensor([[ 0.0000, -0.3777, 0.5038],
[ 0.3777, 0.0000, 0.0781],
[-0.5038, -0.0781, 0.0000]], grad_fn=)
After. Same as Before:
Linear(in_features=3, out_features=3, bias=True)
Parameter containing:
tensor([[ 0.0000, -0.3777, 0.5038],
[ 0.0000, 0.0000, 0.0781],
[ 0.0000, 0.0000, 0.0000]], requires_grad=True)
Describe your environment
Does not matter because there is no bug. It is just the output from the tutorial page.