leandron commented on code in PR #10941:
URL: https://github.com/apache/tvm/pull/10941#discussion_r847338062


##########
python/tvm/driver/tvmc/frontends.py:
##########
@@ -284,13 +285,48 @@ def load(self, path, shape_dict=None, **kwargs):
         return relay.frontend.from_paddle(prog, shape_dict=shape_dict, 
**kwargs)
 
 
+class TextFrontend(Frontend):
+    """Text (Relay) frontend for TVMC"""
+
+    @staticmethod
+    def name():
+        return "text"
+
+    @staticmethod
+    def suffixes():
+        return ["relay", "txt", "text"]
+
+    def load(self, path, shape_dict=None, **kwargs):
+        with open(path, "r", encoding="utf-8") as relay_text:
+            text = relay_text.read()
+        if shape_dict is not None:
+            logger.warning("Supplied shape_dict argument ignored for text 
frontend")
+        ir_mod = parser.fromtext(text)

Review Comment:
   Just to clarify my point, I think this `parser.fromtext()` call is 
appropriate because the full name of the module makes it implicit that it 
refers to Relay, given it is `relay.parser.fromtext()`.



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