Repository navigation
Fix Chomp1d zero-size identity for TCN unit kernels - #1219
Merged
bruAristimunha merged 8 commits intoOct 5, 2026
Merged
bruAristimunha merged 8 commits into
bruAristimunha merged 8 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1219 +/- ##
=======================================
Coverage 87.84% 87.84%
=======================================
Files 151 151
Lines 17600 17602 +2
=======================================
+ Hits 15460 15462 +2
Misses 2140 2140 🚀 New features to boost your workflow:
|
Resolved docs/whats_new.rst by keeping both changelog entries.
bruAristimunha
approved these changes
Oct 4, 2026
bruAristimunha
left a comment
Collaborator
There was a problem hiding this comment.
Thanks. Reproduced the Chomp1d zero-size slice on master, verified the identity path and that every caller's default output is unchanged. CI green.
Resolved docs/whats_new.rst by keeping both changelog entries.
bruAristimunha
approved these changes
Oct 5, 2026
bruAristimunha
left a comment
Collaborator
There was a problem hiding this comment.
Thanks. Reproduced the Chomp1d zero-size slice on master, verified the identity path and that every caller's default output is unchanged. CI green.
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.
Summary
Fix
Chomp1d(0)returning an empty time axis and restoreTCN(kernel_size=1).Root cause
Chomp1d.forward()currently slices with:For
chomp_size == 0, Python interprets:-0as:0, so a valid zero-chomp operation removes the entire temporal axis.This is reachable from the public TCN configuration:
kernel_size=1gives causal padding(kernel_size - 1) * dilation == 0, so both temporal blocks constructChomp1d(0).Fix
Treat zero chomp as the identity operation. Positive chomp sizes retain the existing slice behavior.
Regression coverage
Chomp1d(0)preserves shape and values;TCN(kernel_size=1)completes a forward pass;I also reproduced the boundary independently on CPU: the current implementation maps an input of shape
(2, 3, 11)to(2, 3, 0), and a unit-kernel temporal block then fails at the second convolution because the time dimension is empty. With the zero-chomp identity guard, the block preserves the 17-step reference length and returns finite outputs.AI assistance was used to audit the boundary condition and prepare the patch; the change is intentionally limited to the zero-chomp contract and its regressions.