From 40a4a53209298921e95cb1d9abf5a578f6736fc3 Mon Sep 17 00:00:00 2001 From: Zhang Qinghua Date: Fri, 23 Oct 2020 11:43:31 +0800 Subject: [PATCH] Should not incorporate if the fg has bprop function. --- .../ccsrc/frontend/optimizer/irpass/incorporate_getitem.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mindspore/ccsrc/frontend/optimizer/irpass/incorporate_getitem.h b/mindspore/ccsrc/frontend/optimizer/irpass/incorporate_getitem.h index 998eb0c8e8..a59a569a74 100644 --- a/mindspore/ccsrc/frontend/optimizer/irpass/incorporate_getitem.h +++ b/mindspore/ccsrc/frontend/optimizer/irpass/incorporate_getitem.h @@ -130,7 +130,7 @@ class IncorporateGetitem : public AnfVisitor { AnfNodePtr operator()(const OptimizerPtr &, const AnfNodePtr &node) override { Reset(); AnfVisitor::Match(prim::kPrimTupleGetItem, {IsCNode, IsValueNode})(node); - if (node->func_graph() == nullptr || idx_ == -1 || fg_ == nullptr) { + if (node->func_graph() == nullptr || idx_ == -1 || fg_ == nullptr || fg_->has_flag(FUNC_GRAPH_FLAG_DEFER_INLINE)) { return nullptr; } @@ -361,7 +361,7 @@ class IncorporateGetitemSwitch : public AnfVisitor { is_in_get_ = false; auto fg = node->func_graph(); - if (idx_ == -1 || switch_ == nullptr || fg == nullptr) { + if (idx_ == -1 || switch_ == nullptr || fg == nullptr || fg->has_flag(FUNC_GRAPH_FLAG_DEFER_INLINE)) { return nullptr; }