Skip to content

Conversation

@Ubospica
Copy link
Contributor

@Ubospica Ubospica commented Mar 25, 2023

Currently the script reports error

@I.ir_module
class Module:
    @R.function
    def main_adjoint(x: R.Tensor((3, 4), dtype="float32")):
        s: R.Shape([3, 2, 2]) = R.shape([3, 2, 2])
        lv: R.Tensor(s, dtype="float32") = R.reshape(x, s)
        return lv

because the relax parser cannot handle Var with ShapeExpr value occuring in R.Tensor annotations.

This PR specifically checks such cases in parser.

Thanks to the observation from @SiriusNEO

cc @Hzfengsy @tqchen

@tvm-bot
Copy link
Collaborator

tvm-bot commented Mar 25, 2023

Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from Reviewers by @-ing them in a comment.

Generated by tvm-bot

@github-actions github-actions bot requested review from Hzfengsy and tqchen March 25, 2023 16:03
@Hzfengsy Hzfengsy changed the title [Fix][TVMScript] Fix Shape Var occurrence in Tensor annotation [Unity][TVMScript] Fix Shape Var occurrence in Tensor annotation Mar 25, 2023
@tqchen tqchen merged commit d377f69 into apache:unity Mar 26, 2023
farshidsp pushed a commit to farshidsp/tvm that referenced this pull request Mar 27, 2023
…che#14404)

This PR enables relax parser to handle Var with ShapeExpr value occuring in R.Tensor annotations.
tqchen pushed a commit that referenced this pull request Apr 1, 2023
)

This PR enables relax parser to handle Var with ShapeExpr value occuring in R.Tensor annotations.
tqchen pushed a commit that referenced this pull request Apr 1, 2023
)

This PR enables relax parser to handle Var with ShapeExpr value occuring in R.Tensor annotations.
tqchen pushed a commit that referenced this pull request Apr 1, 2023
)

This PR enables relax parser to handle Var with ShapeExpr value occuring in R.Tensor annotations.
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.

4 participants