Skip to content

Commit

Permalink
[Relay][Transform] Safe check added for Merge Composite (apache#5562)
Browse files Browse the repository at this point in the history
  • Loading branch information
ANSHUMAN TRIPATHY authored and trevor-m committed Jun 18, 2020
1 parent 9cc0715 commit ec09e66
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/relay/transforms/merge_composite.cc
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ class MergeCompositeWrapper : public ExprMutator {
Expr ExtractPattern(const Call& pattern, const Call& root, Map<std::string, Array<Expr>>* var_map,
Map<Expr, Expr>* call_map) {
// check to make sure both calls are to operators (not functions)
if (!root.defined()) return Expr();
if (!pattern->op->IsInstance<OpNode>() || !root->op->IsInstance<OpNode>()) return Expr();
if (pattern->op.as<OpNode>()->name != root->op.as<OpNode>()->name) return Expr();

Expand Down

0 comments on commit ec09e66

Please sign in to comment.