Repository navigation
Fix rank-mismatch issue in flow.tensor.reshape folders. - #5475
Merged
Merged
Conversation
If the ranks mismatch, we can `return false` ealier. It would cause crash when the rank of lhs is greater than the rnak of rhs.
MaheshRavishankar
requested changes
Apr 16, 2021
| // CHECK-LABEL: @reshapeRankDifferent | ||
| func @reshapeRankDifferent(%arg0: tensor<1xf32>) -> tensor<f32> { | ||
| // CHECK-NEXT: flow.tensor.reshape %arg0 | ||
| %0 = flow.tensor.reshape %arg0 : tensor<1xf32> -> tensor<f32> |
Collaborator
There was a problem hiding this comment.
Interesting test case. I would think this should be a special case and should be treated as the same. THe number of elements is 1 in the source and 0 in the target, but is really 1 in reality.
@benvanik any thoughts?
MaheshRavishankar
approved these changes
Apr 19, 2021
Closed
Merged
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.
If the ranks mismatch, we can
return falseealier. It would causecrash when the rank of lhs is greater than the rnak of rhs.