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


Reply via email to