API

 torch / nn / torch.nn


torch.nn.utils.remove_spectral_norm

torch.nn.utils.remove_spectral_norm(module: T_module, name: str = 'weight') → T_module[source]

Removes the spectral normalization reparameterization from a module.

Parameters
  • module (Module) – containing module

  • name (str, optional) – name of weight parameter

Example

>>> m = spectral_norm(nn.Linear(40, 10))
>>> remove_spectral_norm(m)

此页内容是否对您有帮助