diff --git a/paddle/fluid/framework/ir/adaptive_pool2d_convert_global_pass.cc b/paddle/fluid/framework/ir/adaptive_pool2d_convert_global_pass.cc index 7846016d7e7b290f5b2bc3b2f35242df230dcc83..8eb8274168c4b8c8cfb2a02d41f08177b27ee613 100644 --- a/paddle/fluid/framework/ir/adaptive_pool2d_convert_global_pass.cc +++ b/paddle/fluid/framework/ir/adaptive_pool2d_convert_global_pass.cc @@ -77,13 +77,13 @@ void AdaptivePool2dConvertGlobalPass::ApplyImpl(ir::Graph* graph) const { if (op->HasAttr("global_pooling")) { bool global_pooling = BOOST_GET_CONST(bool, op->GetAttr("global_pooling")); - if (global_pooling) return; + if (global_pooling) continue; } - if (!op->HasAttr("pooling_type")) return; + if (!op->HasAttr("pooling_type")) continue; std::string type = BOOST_GET_CONST(std::string, op->GetAttr("pooling_type")); // adaptive has no effect on max pooling - if (type == "max") return; + if (type == "max") continue; bool adaptive = BOOST_GET_CONST(bool, op->GetAttr("adaptive")); std::vector ksize = BOOST_GET_CONST(std::vector, op->GetAttr("ksize"));