Add additional onnx compat for https://github.com/pytorch/pytorch/issues/92977 (#104)
This commit is contained in:
@@ -23,7 +23,8 @@ def get_padding(kernel_size, dilation=1):
|
||||
class AdaIN1d(nn.Module):
|
||||
def __init__(self, style_dim, num_features):
|
||||
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)
|
||||
|
||||
def forward(self, x, s):
|
||||
|
||||
Reference in New Issue
Block a user