tkonolige commented on a change in pull request #8715:
URL: https://github.com/apache/tvm/pull/8715#discussion_r688082036



##########
File path: python/tvm/micro/session.py
##########
@@ -234,3 +237,69 @@ def create_local_debug_executor(graph_json_str, mod, 
device, dump_root=None):
         graph_json_str,
         dump_root=dump_root,
     )
+
+
+RPC_SESSION = None
+
+
+@register_func("tvm.micro.compile_and_create_micro_session")
+def compile_and_create_micro_session(
+    mod_src_bytes: bytes,
+    template_project_dir: str,
+    project_options: dict = None,
+):
+    """Compile the given libraries and sources into a MicroBinary, then invoke 
create_micro_session.
+
+    Parameters
+    ----------
+    mod_src_bytes : bytes
+        The content of a tarfile which contains the TVM-generated sources 
which together form the
+        SystemLib. This tar is expected to be created by export_library. The 
tar will be extracted
+        into a directory and the sources compiled into a MicroLibrary using 
the Compiler.
+
+    template_project_dir: str
+        The path to a template microTVM Project API project which is used to 
generate the embedded
+        project that is built and flashed onto the target device.
+
+    project_options: dict
+        Options for the microTVM API Server contained in template_project_dir.
+    """
+    global RPC_SESSION

Review comment:
       Yep. I'm not sure clear on the lifetime of the RPC_SESSION object 
though. It looks like the destroyer for it is never called?




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