diff --git a/src/relax/op/op.cc b/src/relax/op/op.cc index f51d2cc74f51..489886e50f76 100644 --- a/src/relax/op/op.cc +++ b/src/relax/op/op.cc @@ -780,7 +780,9 @@ StructInfo ReturnTensorToShapeStructInfo(const Call& call, const BlockBuilder& c const auto* tsinfo = GetStructInfoAs(call->args[0]); ICHECK(tsinfo && tsinfo->shape.defined()); ShapeExpr shape_expr = Downcast(tsinfo->shape.value()); - ICHECK(shape_expr->values.size() == 1); + ICHECK(shape_expr->values.size() == 1) << "relax.tensor_to_shape expected argument to be 1-d, " + << "but " << call << " has argument " << call->args[0] + << " with struct info " << call->args[0]->struct_info_; const IntImmNode* ndim = shape_expr->values[0].as(); ICHECK(ndim); return ShapeStructInfo(ndim->value);