From 74cf1180f008f7402c2e18cddba83ece408d06d0 Mon Sep 17 00:00:00 2001 From: Tristan Konolige Date: Tue, 29 Sep 2020 11:04:47 -0600 Subject: [PATCH] Check that alteroplayout is definedbefore using it --- src/relay/transforms/transform_layout.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/relay/transforms/transform_layout.h b/src/relay/transforms/transform_layout.h index bbd5b092a3cee..5921e1c2c9c13 100644 --- a/src/relay/transforms/transform_layout.h +++ b/src/relay/transforms/transform_layout.h @@ -269,9 +269,10 @@ Expr LayoutRewriter(const Call& ref_call, const Array& new_args, const Obj // If there is no FInferCorrectLayout for the type, then we just assume the layout is correct. static auto finfer_layout = Op::GetAttrMap("FInferCorrectLayout"); + static auto falter_layout = Op::GetAttrMap("FTVMAlterOpLayout"); if (ref_call->op.as()) { Op op = Downcast(ref_call->op); - if (!finfer_layout.count(op)) { + if (falter_layout.count(op) && !finfer_layout.count(op)) { return memorizer.CallWithNewLayouts(ref_call, normal_new_args); } }