[ML] Remove invalid Reshape() call on output tensor in RSampler#21448
Merged
siliataider merged 1 commit intoroot-project:masterfrom Mar 2, 2026
Merged
[ML] Remove invalid Reshape() call on output tensor in RSampler#21448siliataider merged 1 commit intoroot-project:masterfrom
siliataider merged 1 commit intoroot-project:masterfrom
Conversation
vepadulano
approved these changes
Mar 2, 2026
Member
vepadulano
left a comment
There was a problem hiding this comment.
LGTM! Small typo in the commit message 'Resahpe'
4a8c553 to
96f9455
Compare
Test Results 20 files 20 suites 2d 20h 27m 13s ⏱️ Results for commit 96f9455. |
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.
This Pull request:
Changes or fixes:
RandomOver/UnderSamplertakesRFlat2DMatrix &ShuffledTensorwhich may be default-constructed (size 0 at that point) and callsReshape()on it, which will fail when it reaches the lineassert(rows * cols == fRVec.size());, as it does not allocate storage.The call is also unnecessary: few lines below that, the function calls
ShuffleTensor()which which always resizes the output tensor internally (callsResize(rows, cols))So this PR removed the
Reshape()call and relies onShuffleTensor()to size the output tensor correctly.Note
The assertion was triggered after moving the sampler implementation from header to source file in #21397