This is an automated email from the ASF dual-hosted git repository.

syfeng 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 4d99ec5d9e [Relax] Fix bug in convert_layout pass (#17541)
4d99ec5d9e is described below

commit 4d99ec5d9e77f2fe1a0e13fe5339865e6536b371
Author: Honglin Zhu <[email protected]>
AuthorDate: Sat Nov 23 20:57:00 2024 +0800

    [Relax] Fix bug in convert_layout pass (#17541)
    
    fix segment fault when get undef layout
---
 src/relax/transform/convert_layout.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/relax/transform/convert_layout.cc 
b/src/relax/transform/convert_layout.cc
index 2048f0dded..3798bdff35 100644
--- a/src/relax/transform/convert_layout.cc
+++ b/src/relax/transform/convert_layout.cc
@@ -90,7 +90,7 @@ class LayoutConvertMutator : public ExprMutator {
   Expr RewriteExpr(const Expr& expr, const NLayout& to) {
     auto fvisitleaf = [&](const Expr& expr, std::array<NLayout, 2> layouts) -> 
Expr {
       NLayout from = layouts[0], to = layouts[1];
-      if (NLayoutEqual()(from, to) || layouts[0].LeafValue()->layout->name == 
"") return expr;
+      if (NLayoutEqual()(from, to) || layouts[0].LeafValue()->layout.name() == 
"") return expr;
       // If not both from and to are unknown, then none of them can be unknown.
       ICHECK(!NLayoutEqual()(from, LayoutDecision::InitUnknownDim()) &&
              !NLayoutEqual()(to, LayoutDecision::InitUnknownDim()))

Reply via email to