tqchen commented on a change in pull request #9980:
URL: https://github.com/apache/tvm/pull/9980#discussion_r790085393



##########
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:
       GetObjectPtr<Executable>(this);

##########
File path: include/tvm/runtime/vm/vm.h
##########
@@ -174,7 +174,7 @@ class VirtualMachine : public runtime::ModuleNode {
    * \brief load the executable for the virtual machine.
    * \param exec The executable.
    */
-  virtual void LoadExecutable(Executable* exec);
+  virtual void LoadExecutable(const ObjectRef& exec);

Review comment:
       consider change to `ObjectPtr<Executable>` which can be constructed via 
https://github.com/apache/tvm/blob/main/include/tvm/runtime/object.h#L877 




-- 
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]


Reply via email to