[Relax] Allow dynamic shape argument to R.reshape#17218
Merged
Conversation
This was referenced Jul 30, 2024
tqchen
approved these changes
Aug 26, 2024
Prior to this commit, the `shape` argument to `R.reshape` was required to either be an in-line `relax::ShapeExpr`, or a variable that had been bound to a `relax::ShapeExpr` within the current function. As a result, shapes that were provided as function arguments or that were produced by another operation (e.g. `R.tensor_to_shape`) would unnecessarily trigger an error. This commit updates the `VMBuiltinLower` pass to instead check that the argument has `relax::ShapeStructInfo`. Closes apache#17217
053edcb to
0ea564e
Compare
Contributor
Author
|
Thank you for the review, and rebased onto main to resolve conflicts. |
Contributor
Author
|
@tvm-bot rerun Rerunnning since the CI results were a week old, and will merge into main after CI. |
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.
Prior to this commit, the
shapeargument toR.reshapewas required to either be an in-linerelax::ShapeExpr, or a variable that had been bound to arelax::ShapeExprwithin the current function. As a result, shapes that were provided as function arguments or that were produced by another operation (e.g.R.tensor_to_shape) would unnecessarily trigger an error.This commit updates the
VMBuiltinLowerpass to instead check that the argument hasrelax::ShapeStructInfo.Closes #17217