masahi commented on a change in pull request #5493:
URL: https://github.com/apache/incubator-tvm/pull/5493#discussion_r418514816
##########
File path: src/relay/transforms/partition_graph.cc
##########
@@ -470,115 +353,82 @@ class Partitioner : public ExprMutator {
Expr GetFunctionOutput(AnnotatedRegion region, const Expr& end_arg) {
Expr arg = Downcast<Call>(end_arg)->args[0];
// Function has one output.
- if (region_return_indices_[region].size() == 1) {
- return region_function_calls[region];
+ if (region_func_meta_[region].out_expr_indices.size() == 1) {
+ return region_func_meta_[region].func_call;
}
+
// Function has multiple outputs.
// Use already made TupleGetItem.
- if (region_return_tuplegetitem_.count(region) &&
- region_return_tuplegetitem_[region].count(arg)) {
- return region_return_tuplegetitem_[region][arg];
+ if (region_func_meta_[region].out_expr_indices.count(arg) &&
+ region_func_meta_[region].out_expr_indices[arg].second.defined()) {
Review comment:
Unless there is a need to cache the created `TupleGetItem`, we can
remove this if block and always create a new `TupleGetItem` given `func_call`
and the index. We can also remove `TupleGetItem` from `out_expr_indices`.
----------------------------------------------------------------
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]