Skip to content

Commit

Permalink
Update model.py
Browse files Browse the repository at this point in the history
  • Loading branch information
williamyang1991 authored Sep 19, 2023
1 parent 60ba4bd commit e593d16
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions models/stylegan2/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ def __init__(

fan_in = in_channel * kernel_size ** 2
self.scale = 1 / math.sqrt(fan_in)
self.padding = kernel_size // 2 + dilation - 1 ##### modified
self.padding = (kernel_size - 1) // 2 * dilation ##### modified

self.weight = nn.Parameter(
torch.randn(1, out_channel, in_channel, kernel_size, kernel_size)
Expand Down Expand Up @@ -657,7 +657,7 @@ def __init__(

else:
stride = 1
self.padding = kernel_size // 2 + dilation-1 ## modified
self.padding = (kernel_size - 1) // 2 * dilation ## modified

layers.append(
EqualConv2d(
Expand Down Expand Up @@ -765,4 +765,4 @@ def forward(self, input):
out = out.view(batch, -1)
out = self.final_linear(out)

return out
return out

0 comments on commit e593d16

Please sign in to comment.