Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix rank-mismatch issue in flow.tensor.reshape folders. #5475

Merged
merged 1 commit into from
Apr 19, 2021

Conversation

hanhanW
Copy link
Contributor

@hanhanW hanhanW commented Apr 16, 2021

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.

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.
// 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>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

@hanhanW hanhanW merged commit 03f455b into iree-org:main Apr 19, 2021
@hanhanW hanhanW deleted the reshape-shape branch April 19, 2021 16:32
@hanhanW hanhanW mentioned this pull request Apr 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants