You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2022/05/12 14:32:50 UTC

[GitHub] [tvm] Lunderberg opened a new pull request, #11289: [Schedule] Allowed typing.Tuple in tir.schedule._type_checker

Lunderberg opened a new pull request, #11289:
URL: https://github.com/apache/tvm/pull/11289

   Previously, `typing.Tuple` annotations could not be used with `tir.schedule._type_checker.type_checked` annotations.  This allows `Tuple` type annotations to be type-checked.


-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tvm] vinx13 commented on a diff in pull request #11289: [Schedule] Allowed typing.Tuple in tir.schedule._type_checker

Posted by GitBox <gi...@apache.org>.
vinx13 commented on code in PR #11289:
URL: https://github.com/apache/tvm/pull/11289#discussion_r871620960


##########
python/tvm/tir/schedule/_type_checker.py:
##########
@@ -134,14 +169,25 @@ def _type_check_atomic(v: Any, name: str, type_: Any) -> Optional[str]:
         return None if isinstance(v, type_) else _type_check_err(v, name, type_)
 
     def _type_check_list(v: List[Any], name: str, type_: Any) -> Optional[str]:
-        if not isinstance(v, (list, tuple)):
+        if not isinstance(v, list):

Review Comment:
   implicit cast from tuple to list is allowed if the element types are the same



-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tvm] Lunderberg commented on pull request #11289: [Schedule] Allowed typing.Tuple in tir.schedule._type_checker

Posted by GitBox <gi...@apache.org>.
Lunderberg commented on PR #11289:
URL: https://github.com/apache/tvm/pull/11289#issuecomment-1131679196

   @vinx13 @junrushao1994 CI passing, and ready for review.


-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tvm] Lunderberg commented on a diff in pull request #11289: [Schedule] Allowed typing.Tuple in tir.schedule._type_checker

Posted by GitBox <gi...@apache.org>.
Lunderberg commented on code in PR #11289:
URL: https://github.com/apache/tvm/pull/11289#discussion_r871756366


##########
python/tvm/tir/schedule/_type_checker.py:
##########
@@ -134,14 +169,25 @@ def _type_check_atomic(v: Any, name: str, type_: Any) -> Optional[str]:
         return None if isinstance(v, type_) else _type_check_err(v, name, type_)
 
     def _type_check_list(v: List[Any], name: str, type_: Any) -> Optional[str]:
-        if not isinstance(v, (list, tuple)):
+        if not isinstance(v, list):

Review Comment:
   Got it.  I wasn't sure if that was intended behavior, or was an early version of supporting tuples.  It makes sense for it to be intended behavior, since both are converted to `Array<T>` by the ffi.  I will revert this line.



-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tvm] vinx13 merged pull request #11289: [Schedule] Allowed typing.Tuple in tir.schedule._type_checker

Posted by GitBox <gi...@apache.org>.
vinx13 merged PR #11289:
URL: https://github.com/apache/tvm/pull/11289


-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [tvm] junrushao1994 commented on pull request #11289: [Schedule] Allowed typing.Tuple in tir.schedule._type_checker

Posted by GitBox <gi...@apache.org>.
junrushao1994 commented on PR #11289:
URL: https://github.com/apache/tvm/pull/11289#issuecomment-1125605313

   Thanks for improving the type checker! Maybe at some time point we could together propose to lift this to top-level TVM utility with an RFC :-)


-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org