tvm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [incubator-tvm] comaniac edited a comment on pull request #5703: [PatternLang] Simplify Pattern API Implementations
Date Mon, 01 Jun 2020 18:51:03 GMT

comaniac edited a comment on pull request #5703:
URL: https://github.com/apache/incubator-tvm/pull/5703#issuecomment-637038571


   Ah, this is a bit tricky. For type annotation, we should use `DFPattern` in this case.
However, in Python 3.6, it evaluates the annotations at function definition time. It means
if we define a class and refer it in the same file, the type checking won't find that class
and will report type errors. While this issue has been fixed in Python 3.7, an official workaround
is using a string for the class type. You can see https://stackoverflow.com/questions/15853469/putting-current-class-as-return-type-annotation
for details.
   
   Since TVM hasn't officially required Python 3.7+, I'd make sure the type annotation we
are using is Python 3.6 compatible.


----------------------------------------------------------------
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:
users@infra.apache.org



Mime
View raw message