comaniac commented on a change in pull request #5320: [BYOC] Prevent duplicate
outputs in subgraph Tuple
URL: https://github.com/apache/incubator-tvm/pull/5320#discussion_r407699154
##########
File path: src/relay/analysis/annotated_region_set.cc
##########
@@ -131,7 +131,13 @@ class AnnotatedRegionSet::Creator : public ExprVisitor {
CHECK_EQ(region->GetTarget(), target);
}
region->nodes_.insert(GetRef<Call>(call));
- region->outs_.push_back(GetRef<Call>(call));
+ if (!std::any_of(region->outs_.begin(), region->outs_.end(),
Review comment:
You probably need to add this logic to `MergeRegion`, too. Since this logic
should be used every time we want to manipulate region outputs, I'd prefer to
have an API like `Region::AddOutput` and make `outs_` private.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services