Unverified Commit cf46b7bd authored by Lei Wang's avatar Lei Wang Committed by GitHub
Browse files

[Bugfix] Improve error handling in LayoutNode::InverseWithLevel (#1215) (#1220)

* Added logging and exception handling for layout errors in InverseWithLevel method.
* Replaced direct error check with a throw statement to enhance error reporting and debugging capabilities.
parent 7e5b1cd2
......@@ -5,6 +5,7 @@
#include "layout.h"
#include <tvm/ffi/reflection/registry.h>
#include <tvm/runtime/logging.h>
#include <tvm/arith/pattern.h>
#include <tvm/tir/op.h>
......@@ -255,8 +256,11 @@ std::pair<Layout, arith::IterMapLevel> LayoutNode::InverseWithLevel() const {
}
arith::IterMapResult res =
arith::DetectIterMap(forward_index_, getVarMap(), 1, level, &analyzer);
ICHECK(res->errors.empty())
<< "Layout " << DebugOutput() << " has errors: " << res->errors;
if (!res->errors.empty()) {
std::ostringstream msg;
msg << "Layout " << DebugOutput() << " has errors: " << res->errors;
throw NormalizeIterException(msg.str());
}
auto outputs_shape = OutputShape();
Array<PrimExpr> outputs;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment