Files
SillyTavern-extras/live2d/tha3/nn/spectral_norm.py
2023-07-31 08:35:30 +09:00

10 lines
252 B
Python

from torch.nn import Module
from torch.nn.utils import spectral_norm
def apply_spectral_norm(module: Module, use_spectrial_norm: bool = False) -> Module:
if use_spectrial_norm:
return spectral_norm(module)
else:
return module