Add zero, constant, reflection and replication padding layers - #103
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #103 +/- ##
==========================================
- Coverage 97.51% 97.47% -0.04%
==========================================
Files 59 60 +1
Lines 2938 3011 +73
==========================================
+ Hits 2865 2935 +70
- Misses 73 76 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This was referenced Aug 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Standalone padding layers, for the cases where the padding and the convolution want separate control.
pt.padalready does the work, so these are mostly an argument surface over_pad_spatial— which moved out of the conv module on the way, since padding isn't convolution.Two deliberate differences from torch. Padding is one entry per axis in input order,
((top, bottom), (left, right)), rather than torch's flat last-axis-first sequence; axis order is what the rest of the library already uses, and a flat 4-tuple gets an error saying so. And a reflection wider than the axis folds back and forth like numpy's, where torch refuses.Part of #2.