Skip to content

Commit 74cf118

Browse files
committed
Check that alteroplayout is definedbefore using it
1 parent 69fe439 commit 74cf118

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/relay/transforms/transform_layout.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,9 +269,10 @@ Expr LayoutRewriter(const Call& ref_call, const Array<Expr>& new_args, const Obj
269269

270270
// If there is no FInferCorrectLayout for the type, then we just assume the layout is correct.
271271
static auto finfer_layout = Op::GetAttrMap<FInferCorrectLayout>("FInferCorrectLayout");
272+
static auto falter_layout = Op::GetAttrMap<FTVMAlterOpLayout>("FTVMAlterOpLayout");
272273
if (ref_call->op.as<OpNode>()) {
273274
Op op = Downcast<Op>(ref_call->op);
274-
if (!finfer_layout.count(op)) {
275+
if (falter_layout.count(op) && !finfer_layout.count(op)) {
275276
return memorizer.CallWithNewLayouts(ref_call, normal_new_args);
276277
}
277278
}

0 commit comments

Comments
 (0)