Open
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7017 +/- ##
==========================================
+ Coverage 69.26% 69.27% +0.01%
==========================================
Files 384 384
Lines 67207 67254 +47
==========================================
+ Hits 46550 46593 +43
- Misses 20657 20661 +4 ☔ View full report in Codecov by Sentry. |
azecevicTT
approved these changes
Feb 12, 2026
Comment on lines
2612
to
2625
| // Compute the slice result type. | ||
| RankedTensorType sliceResultType; | ||
| if (needPad) { | ||
| // Intermediate type: sliced shape. | ||
| SmallVector<int64_t> slicedShape; | ||
| for (size_t i = 0; i < inputShape.size(); i++) { | ||
| slicedShape.push_back(sliceEnds[i] - sliceBegins[i]); | ||
| } | ||
| sliceResultType = | ||
| RankedTensorType::get(slicedShape, inputType.getElementType()); | ||
| } else { | ||
| // Final output type when only slicing is needed. | ||
| sliceResultType = cast<RankedTensorType>(op.getType()); | ||
| } |
Contributor
There was a problem hiding this comment.
IMO you don't have to optimize the case for the case when padding is not needed, you can put the calculation of the shape in the previous loop, that way it's much more obvious what the intention is.
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.
Ticket
closes #6959
Problem description
PyTorch supports negative padding in pad op as cropping. TTNN padOp does not allow this and causes errors.
What's changed
Added decomposition to
ttir.slice_staticop if there is negative padding.Checklist