Skip to content

Commit

Permalink
fix the bug in repeated_fc_relu_fuse_pass.test=develop (#33386) (#33431)
Browse files Browse the repository at this point in the history
  • Loading branch information
winter-wang authored Jun 10, 2021
1 parent d496722 commit c4a417f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions paddle/fluid/framework/ir/repeated_fc_relu_fuse_pass.cc
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,13 @@ static bool IsFCWithPaddingWeights(Node* n) {
}

static bool IsParamOfFC(Node* n, const std::string& param_name) {
if (IsInputOfFC(n) && n->inputs.empty() &&
(n->Name() == n->outputs[0]->Op()->Input(param_name)[0])) {
return true;
if (IsInputOfFC(n) && n->inputs.empty()) {
for (auto* out : n->outputs) {
if (out->Op()->Type() == "fc" &&
n->Name() == out->Op()->Input(param_name)[0]) {
return true;
}
}
}
return false;
}
Expand Down

0 comments on commit c4a417f

Please sign in to comment.