sunggg commented on code in PR #14282:
URL: https://github.com/apache/tvm/pull/14282#discussion_r1142777697
##########
src/relax/backend/vm/vm_builtin_lower.cc:
##########
@@ -129,9 +129,23 @@ class VMBuiltinLowerMutator : public ExprMutator {
Expr Reshape(const Call& call_node) {
ICHECK(call_node->args.size() == 2);
ICHECK(call_node->struct_info_.defined());
- CHECK(call_node->args[1]->IsInstance<ShapeExprNode>())
- << "VMBuiltinLower expects the shape arg of reshape op to be a
ShapeExpr";
- return Call(builtin_reshape_, call_node->args, Attrs(),
{GetStructInfo(call_node)});
+ auto arg = call_node->args[1];
+ CHECK(arg->IsInstance<ShapeExprNode>() || arg->IsInstance<VarNode>())
+ << "VMBuiltinLower expects the shape arg of reshape op to be a
ShapeExpr or VarNode bound "
+ "to a ShapeExpr";
+
+ if (arg->IsInstance<ShapeExprNode>()) {
+ return Call(builtin_reshape_, call_node->args, Attrs(),
{GetStructInfo(call_node)});
+ }
+
+ ICHECK(arg->IsInstance<VarNode>());
Review Comment:
Removed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]