Browse Source

Should not incorporate if the fg has bprop function.

tags/v1.1.0
Zhang Qinghua 5 years ago
parent
commit
40a4a53209
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      mindspore/ccsrc/frontend/optimizer/irpass/incorporate_getitem.h

+ 2
- 2
mindspore/ccsrc/frontend/optimizer/irpass/incorporate_getitem.h View File

@@ -130,7 +130,7 @@ class IncorporateGetitem : public AnfVisitor {
AnfNodePtr operator()(const OptimizerPtr &, const AnfNodePtr &node) override { AnfNodePtr operator()(const OptimizerPtr &, const AnfNodePtr &node) override {
Reset(); Reset();
AnfVisitor::Match(prim::kPrimTupleGetItem, {IsCNode, IsValueNode<Int32Imm>})(node); AnfVisitor::Match(prim::kPrimTupleGetItem, {IsCNode, IsValueNode<Int32Imm>})(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; return nullptr;
} }


@@ -361,7 +361,7 @@ class IncorporateGetitemSwitch : public AnfVisitor {
is_in_get_ = false; is_in_get_ = false;


auto fg = node->func_graph(); 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; return nullptr;
} }




Loading…
Cancel
Save