Skip to content

Commit

Permalink
fixing potential bug with dilations, although none of our models use it.
Browse files Browse the repository at this point in the history
  • Loading branch information
adefossez committed Mar 31, 2023
1 parent 2a5c2f7 commit 6e8d7ed
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion encodec/modules/conv.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,8 @@ def forward(self, x):
kernel_size = self.conv.conv.kernel_size[0]
stride = self.conv.conv.stride[0]
dilation = self.conv.conv.dilation[0]
padding_total = (kernel_size - 1) * dilation - (stride - 1)
kernel_size = (kernel_size - 1) * dilation + 1 # effective kernel size with dilations
padding_total = kernel_size - stride
extra_padding = get_extra_padding_for_conv1d(x, kernel_size, stride, padding_total)
if self.causal:
# Left padding for causal
Expand Down

0 comments on commit 6e8d7ed

Please sign in to comment.