gromero commented on a change in pull request #8086:
URL: https://github.com/apache/tvm/pull/8086#discussion_r636601079



##########
File path: python/tvm/driver/tvmc/model.py
##########
@@ -233,6 +232,43 @@ def export_package(
 
         return package_path
 
+    def export_package(
+        self,
+        executor_factory: GraphExecutorFactoryModule,
+        package_path: Optional[str] = None,
+        cross: Optional[Union[str, Callable]] = None,
+        output_format: str = "so",
+    ):
+        """Save this TVMCModel to file.
+        Parameters
+        ----------
+        executor_factory : GraphExecutorFactoryModule
+            The factory containing compiled the compiled artifacts needed to 
run this model.
+        package_path : str, None
+            Where the model should be saved. Note that it will be packaged as 
a .tar file.
+            If not provided, the package will be saved to a generically named 
file in tmp.
+        cross : str or callable object, optional
+            Function that performs the actual compilation.
+        output_format : str
+            How to save the modules function library. Must be one of "so" and 
"tar" to save
+            using the classic format or "mlf" to save using the Model Library 
Format.
+
+        Returns
+        -------
+        package_path : str
+            The path that the package was saved to.
+        """
+        if output_format not in ["so", "tar", "mlf"]:
+            raise TVMCException("Only 'so', 'tar', and 'mlf' output formats 
are supported.")
+
+        if output_format == "mlf" and cross:
+            raise TVMCException("Specifying the MLF output and a cross 
compiler is not supported.")
+
+        if output_format in ["so", "tar"]:
+            return self.export_classic_format(executor_factory, package_path, 
cross, output_format)
+        else:

Review comment:
       sure! 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