Skip to content

Commit

Permalink
[Bugfix] fskip of EliminateCommonSubexpr cannot always return false (a…
Browse files Browse the repository at this point in the history
…pache#4620)

* 'fskip' will not always return false

fskip returns false at the end of PackedFunc, discards return true in 'cast' case

* Update build_module.cc
  • Loading branch information
yuliujq authored and alexwong committed Feb 26, 2020
1 parent 157b711 commit 420cd3f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/relay/backend/build_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ class RelayBuildModule : public runtime::ModuleNode {
pass_seqs.push_back(transform::SimplifyInference());
PackedFunc fskip = PackedFunc([](TVMArgs args, TVMRetValue* rv) {
Expr expr = args[0];
*rv = false;
if (expr.as<CallNode>()) {
auto call_node = expr.as<CallNode>();
auto op_node = call_node->op.as<OpNode>();
Expand All @@ -328,7 +329,6 @@ class RelayBuildModule : public runtime::ModuleNode {
}
}
}
*rv = false;
});
pass_seqs.push_back(transform::EliminateCommonSubexpr(fskip));
pass_seqs.push_back(transform::CombineParallelConv2D(3));
Expand Down

0 comments on commit 420cd3f

Please sign in to comment.