You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2021/04/23 22:43:02 UTC

[GitHub] [tvm] areusch commented on a change in pull request #7902: [FIX,VM] Fix get_outputs on the vm with a single output

areusch commented on a change in pull request #7902:
URL: https://github.com/apache/tvm/pull/7902#discussion_r619499432



##########
File path: src/runtime/vm/vm.cc
##########
@@ -142,11 +142,21 @@ PackedFunc VirtualMachine::GetFunction(const std::string& name,
     });
   } else if (name == "get_output") {
     return TypedPackedFunc<NDArray(int64_t)>([this](int64_t index) {
-      return Downcast<NDArray>(Downcast<ADT>(this->return_register_)[index]);
+      if (this->return_register_.as<ADTObj>()) {
+        return Downcast<NDArray>(Downcast<ADT>(this->return_register_)[index]);
+      } else {
+        return Downcast<NDArray>(this->return_register_);

Review comment:
       should we assert `index == 0` or enforce some interface to make sure ppl don't think they are reading a tuple when they are not?




-- 
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:
users@infra.apache.org