tkonolige commented on code in PR #11358:
URL: https://github.com/apache/tvm/pull/11358#discussion_r967288970
##########
src/runtime/vm/vm.cc:
##########
@@ -143,8 +143,15 @@ PackedFunc VirtualMachine::GetFunction(const std::string&
name,
} else {
auto it = inputs_.find(func_name);
ICHECK(it != inputs_.end()) << "Input has not been set for function "
<< func_name;
- const std::vector<ObjectRef>& func_args = it->second;
- *rv = Invoke(func, func_args);
+ const std::vector<ObjectRef>& input_args = it->second;
+ if (set_outputs_enabled_.count(func_name) &&
set_outputs_enabled_[func_name]) {
+ ICHECK(outputs_.count(func_name))
+ << "Outputs have not been set for function " << func_name;
+ *rv = Invoke(func, input_args, outputs_[func_name]);
+ set_outputs_enabled_[func_name] = false;
Review Comment:
The register file holds a reference to the outputs too. So if we clear
`outputs_`, they will be released only when the register file is reset.
--
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]