This commit is contained in:
Adrian Lyjak
2025-02-18 13:06:48 -06:00
committed by GitHub
parent cd7afb5c12
commit e648c0605a

View File

@@ -23,7 +23,8 @@ def get_padding(kernel_size, dilation=1):
class AdaIN1d(nn.Module): class AdaIN1d(nn.Module):
def __init__(self, style_dim, num_features): def __init__(self, style_dim, num_features):
super().__init__() super().__init__()
self.norm = nn.InstanceNorm1d(num_features, affine=False) # affine should be False, however there's a bug in the old torch.onnx.export (not newer dynamo) that causes the channel dimension to be lost if affine=False. When affine is true, there's additional learnably parameters. This shouldn't really matter setting it to True, since we're in inference mode
self.norm = nn.InstanceNorm1d(num_features, affine=True)
self.fc = nn.Linear(style_dim, num_features*2) self.fc = nn.Linear(style_dim, num_features*2)
def forward(self, x, s): def forward(self, x, s):