tqchen commented on a change in pull request #9980:
URL: https://github.com/apache/tvm/pull/9980#discussion_r793190074
##########
File path: src/runtime/vm/executable.cc
##########
@@ -86,7 +86,7 @@ PackedFunc Executable::GetFunction(const std::string& name,
const ObjectPtr<Obje
} else if (name == "vm_load_executable") {
return PackedFunc([sptr_to_self, this](TVMArgs args, TVMRetValue* rv) {
auto vm = make_object<VirtualMachine>();
- vm->LoadExecutable(this);
+ vm->LoadExecutable(ObjectRef(sptr_to_self));
Review comment:
Sorry for the delayed reply. sptr_to_self actually is guanranteed to
point to `this` in this particular case. So actually
`GetObjectPtr<Executable>(...)` should work in this case. This is mainly
because ObjectPtr is an intrusive pointer that directly leverages the object
data structure.
To confirm, we can add `ICHECK(sptr_to_self.get() == this);`
--
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]