lhutton1 commented on a change in pull request #5770:
URL: https://github.com/apache/incubator-tvm/pull/5770#discussion_r440275397



##########
File path: python/tvm/runtime/module.py
##########
@@ -222,21 +222,29 @@ def evaluator(*args):
         except NameError:
             raise NameError("time_evaluate is only supported when RPC is 
enabled")
 
-    def _collect_dso_modules(self):
-        """Helper function to collect dso modules, then return it."""
-        visited, stack, dso_modules = set(), [], []
+    def _collect_dso_metadata_modules(self):
+        """
+        Helper function to collect dso modules and metadata init module. There
+        is at most one medata init module if it exists.
+        """
+        visited, stack, dso_modules, metadata_init = set(), [], [], None
         # append root module
         visited.add(self)
         stack.append(self)
         while stack:
             module = stack.pop()
             if module._dso_exportable():
                 dso_modules.append(module)
+            elif module.type_key == "module_init":
+                assert not metadata_init, \
+                        "At most one module initializer is allowed"

Review comment:
       Makes sense thanks, I was thinking one MetadataModule would be created 
for each backend.




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