Skip to content

Commit

Permalink
[Relax] Fix bug in convert_layout pass (#17541)
Browse files Browse the repository at this point in the history
fix segment fault when get undef layout
  • Loading branch information
HongHongHongL authored Nov 23, 2024
1 parent 27eed54 commit 4d99ec5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/relax/transform/convert_layout.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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()))
Expand Down

0 comments on commit 4d99ec5

Please sign in to comment.