jroesch commented on a change in pull request #7746:
URL: https://github.com/apache/tvm/pull/7746#discussion_r603529469



##########
File path: src/runtime/vm/executable.cc
##########
@@ -477,7 +485,17 @@ void LoadHeader(dmlc::Stream* strm) {
 
 runtime::Module Executable::Load(const std::string& code, const 
runtime::Module lib) {
   auto exec = make_object<Executable>();
-  exec->lib = lib;
+
+  // Support null-initialization of lib, to enable initialization during
+  // deserialization before we have we have deserialized the imports.
+  if (lib.defined()) {
+    ICHECK_EQ(exec->imports_.size(), 0)
+        << "A VMExecutable should never have more than one import inside an 
the executable, \n"
+        << "the first import should *always* be the library containing"
+        << "the platform specific kernel code";
+    exec->Import(lib);

Review comment:
       Done




-- 
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:
[email protected]


Reply via email to