tqchen commented on a change in pull request #4532: [WIP] Support standardize 
runtime module
URL: https://github.com/apache/incubator-tvm/pull/4532#discussion_r359059779
 
 

 ##########
 File path: python/tvm/module.py
 ##########
 @@ -118,21 +122,22 @@ def export_library(self,
             self.save(file_name)
             return
 
-        if not (self.type_key == "llvm" or self.type_key == "c"):
-            raise ValueError("Module[%s]: Only llvm and c support export 
shared" % self.type_key)
+        module = self._lookup_dso_module()
+        assert module is not None, "We should have one dso module to export"
         temp = _util.tempdir()
         if fcompile is not None and hasattr(fcompile, "object_format"):
             object_format = fcompile.object_format
         else:
-            if self.type_key == "llvm":
+            if module.type_key == "llvm":
                 object_format = "o"
             else:
-                assert self.type_key == "c"
+                assert module.type_key == "c"
                 object_format = "cc"
         path_obj = temp.relpath("lib." + object_format)
-        self.save(path_obj)
+        module.save(path_obj)
 
 Review comment:
   we should have a forloop that saves all dso related modules into the 
corresponding object/cc file

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


With regards,
Apache Git Services

Reply via email to