mikepapadim commented on a change in pull request #9282:
URL: https://github.com/apache/tvm/pull/9282#discussion_r730693816



##########
File path: python/tvm/relay/backend/te_compiler.py
##########
@@ -275,6 +256,46 @@ def select_implementation(op, attrs, inputs, out_type, 
target, use_autotvm=True)
     return best_plevel_impl, outputs[best_plevel_impl]
 
 
+@tvm._ffi.register_object("relay.TECompiler")
+class TECompiler(Object):
+    """TECompiler to get lowered code."""
+
+    def __init__(self):
+        raise RuntimeError("Cannot construct a TECompiler")
+
+    def lower(self, source_func, target=None, mod_name="default"):
+        """Lower a source_func to a CachedFunc.
+
+        Parameters
+        ----------
+        source_func : Union[tvm.relay.Function, CCacheKey]
+            The source relay function.
+
+        target : tvm.Target
+            The target platform.
+
+        Returns
+        -------
+        cached_func: CachedFunc
+            The result of lowering.
+        """
+        # pylint: disable=broad-except, import-outside-toplevel
+        try:
+            mod_name = mangle_module_name(mod_name)
+            key = _get_cache_key(source_func, target)
+            print(key)

Review comment:
       Fixed




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