areusch commented on code in PR #10785:
URL: https://github.com/apache/tvm/pull/10785#discussion_r856390270
##########
src/relay/backend/aot_executor_codegen.cc:
##########
@@ -1052,7 +1075,22 @@ class AOTExecutorCodegen : public MixedModeVisitor {
// Retrieve the return sids
return_sid_ = final_aot_allocator.GetReturnIds();
// Insert outputs to main func signature
- CreateIOVar(lowered_main_func->body, "output");
+ // If output tensor names were provided use them
+ if (auto opt = func->GetAttr<Array<String>>("output_tensor_names")) {
+ Array<String> output_tensor_names = opt.value();
+ if (lowered_main_func->body->IsInstance<TupleNode>()) {
+ Tuple output_tuple = Downcast<Tuple>(lowered_main_func->body);
+ for (unsigned i = 0; i < output_tuple->fields.size(); i++) {
+ CreateIOVar(output_tuple->fields[i], output_tensor_names[i]);
Review Comment:
we might want to also enforce use_unique_name here--since if we ever
implemented GetOutputIndex on AOTExecutor, the user would need to confirm that
the output var didn't get its name mangled. wdyt?
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]