You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by ss...@apache.org on 2024/01/26 01:23:00 UTC
(tvm) branch main updated: [Unity] Improved error message in tvm::relax::UpdateStructInfo (#16472)
This is an automated email from the ASF dual-hosted git repository.
sslyu pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git
The following commit(s) were added to refs/heads/main by this push:
new 8ade9c30ed [Unity] Improved error message in tvm::relax::UpdateStructInfo (#16472)
8ade9c30ed is described below
commit 8ade9c30ed756df307b00c42b94a2abcf639d662
Author: Eric Lunderberg <Lu...@users.noreply.github.com>
AuthorDate: Thu Jan 25 19:22:54 2024 -0600
[Unity] Improved error message in tvm::relax::UpdateStructInfo (#16472)
If the struct info cannot be updated, provide the expression, the
previous struct info, and the new struct info in the error message.
---
src/relax/ir/struct_info.cc | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/relax/ir/struct_info.cc b/src/relax/ir/struct_info.cc
index 302534b414..ac71454f8c 100644
--- a/src/relax/ir/struct_info.cc
+++ b/src/relax/ir/struct_info.cc
@@ -209,7 +209,11 @@ TVM_REGISTER_GLOBAL("relax.FuncStructInfoOpaqueFunc")
// Helper functions
void UpdateStructInfo(Expr expr, StructInfo struct_info) {
ICHECK(!expr->struct_info_.defined())
- << "the struct_info_ of the Expr to be updated must be nullptr for idempotency";
+ << "To ensure idempotency, "
+ << "the expression passed to UpdateStructInfo "
+ << "must not have any prior StructInfo. "
+ << "However, expression " << expr << " has struct info " << expr->struct_info_
+ << ", which cannot be overwritten with " << struct_info;
expr->struct_info_ = struct_info;
// also set checked type
expr->checked_type_ = GetStaticType(struct_info);