Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add helper function applying correct padding for even kernel sizes #54

Merged
merged 2 commits into from
May 21, 2024

Conversation

DanEnergetics
Copy link
Contributor

It was mentioned in #50 and I tested it as well (see test case), the get_same_padding doesn't seem to work for even kernel sizes. It applies the same padding (k - 1)//2 on both sides in a given dimension, which is correct whenever (k-1) is even, otherwise a frame is missing. However, sometimes it does seem to work if stride > 1.
apply_same_padding is to be used as in the test case by first padding the tensor and then calling a convolution without any padding on it.

@DanEnergetics DanEnergetics marked this pull request as ready for review May 16, 2024 07:51
@DanEnergetics DanEnergetics merged commit 1264482 into main May 21, 2024
2 checks passed
@DanEnergetics DanEnergetics deleted the mann_even_kernel_padding branch May 21, 2024 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants