pytorch / 2 / generated / torch.nn.utils.remove_weight_norm.html

torch.nn.utils.remove_weight_norm

torch.nn.utils.remove_weight_norm(module, name='weight') [source]

Removes the weight normalization reparameterization from a module.

Parameters
  • module (Module) – containing module
  • name (str, optional) – name of weight parameter
Return type

T_module

Example

>>> m = weight_norm(nn.Linear(20, 40))
>>> remove_weight_norm(m)

© 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.remove_weight_norm.html