slyubomirsky commented on code in PR #16569:
URL: https://github.com/apache/tvm/pull/16569#discussion_r1490073321


##########
python/tvm/script/parser/core/entry.py:
##########
@@ -77,4 +95,15 @@ def parse(program: Union[doc.AST, Any, str], extra_vars: 
Dict[str, Any] = None)
             parser.parse(extra_vars=extra_vars)
         except ParserError as err:
             parser.report_error(err.node, err.args[0])
-    return builder.get()
+    ret = builder.get()
+    # well-formedness check will ignore any non-Relax functions
+    if isinstance(ret, IRModule):
+        # note: use the walrus operator (:=) once the project Python version
+        # supports it, would be more concise
+        source_ast = source.as_ast()
+        if find_decorator_annotation(source_ast, "check_well_formed") and not 
well_formed(ret):

Review Comment:
   Oh I thought I had gotten rid of it. It doesn't actually work because the 
parser, for whatever reason, does not save a decorator list for the IRModule 
and I don't know how to change it so that it does. I would prefer having it, 
but the present parser can't save that information.



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