Skip to content

Commit

Permalink
[BYOC][MergeComposite] if root->args[i] isn't a CallNode, then Donwca…
Browse files Browse the repository at this point in the history
…st<Call> will check fail

Signed-off-by: windclarion <windclarion@gmail.com>
  • Loading branch information
windclarion authored and Taikang Hu committed May 19, 2020
1 parent 538e296 commit 5bee3d9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/relay/transforms/merge_composite.cc
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,10 @@ class MergeCompositeWrapper : public ExprMutator {
for (const auto& arg : pattern->args) {
Expr new_arg;
if (arg->IsInstance<CallNode>()) {
new_arg =
ExtractPattern(Downcast<Call>(arg), Downcast<Call>(root->args[i]), var_map, call_map);
if (root->args[i]->IsInstance<CallNode>()) {
new_arg =
ExtractPattern(Downcast<Call>(arg), Downcast<Call>(root->args[i]), var_map, call_map);
}
// if we've already processed this call node, return the previous result
if (call_map->find(arg) != call_map->end() && new_arg.defined()) {
new_arg = (*call_map)[arg];
Expand Down

0 comments on commit 5bee3d9

Please sign in to comment.