diff --git a/src/relax/transform/convert_layout.cc b/src/relax/transform/convert_layout.cc index 2048f0ddedf5..3798bdff351d 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 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()))