extrasneo / talkinghead /tha3 /nn /spectral_norm.py
Reiner4's picture
Upload 539 files
65fe463
raw
history blame contribute delete
252 Bytes
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