Skip to content

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

Merged
hanhanW merged 1 commit into
iree-org:mainfrom
hanhanW:reshape-shape
Apr 19, 2021
Merged

hanhanW merged 1 commit into
iree-org:mainfrom
hanhanW:reshape-shape

Conversation

@hanhanW

@hanhanW hanhanW commented Apr 16, 2021

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Collaborator

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