Skip to content

Commit

Permalink
fix adaptive pool pass (#42019)
Browse files Browse the repository at this point in the history
  • Loading branch information
JZZ-NOTE authored Apr 20, 2022
1 parent d67abac commit 747ba3f
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ AdaptivePool2dConvertGlobalPass::AdaptivePool2dConvertGlobalPass() {

void AdaptivePool2dConvertGlobalPass::ApplyImpl(ir::Graph* graph) const {
std::string name_scope = "adaptive_pool2d_convert_global_pass";

FusePassBase::Init(name_scope, graph);
int num = 0;
for (const Node* n : graph->Nodes()) {
Expand All @@ -77,13 +78,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<int> ksize =
BOOST_GET_CONST(std::vector<int>, op->GetAttr("ksize"));
Expand Down

1 comment on commit 747ba3f

@paddle-bot-old
Copy link

@paddle-bot-old paddle-bot-old bot commented on 747ba3f Apr 21, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🕵️ CI failures summary

🔍 PR: #201 Commit ID: 747ba3f contains failed CI.

🔹 Failed: PR-CI-Kunlun-KP-Build

Unknown Failed
Unknown Failed

🔹 Failed: PR-CI-Coverage

Unknown Failed
Unknown Failed

Please sign in to comment.