vinx13 commented on code in PR #12288:
URL: https://github.com/apache/tvm/pull/12288#discussion_r936993409
##########
python/tvm/tir/schedule/_type_checker.py:
##########
@@ -177,6 +197,19 @@ def _type_check_list(v: List[Any], name: str, type_: Any)
-> Optional[str]:
return error_msg
return None
+ def _type_check_dict(dict_obj: Dict[Any, Any], name: str, *types: Any) ->
Optional[str]:
+ ktype_, vtype_ = types
+ if not isinstance(dict_obj, dict):
+ return _type_check_err(dict_obj, name, dict)
+ for k, v in dict_obj.items():
+ error_msg = _type_check(k, f"{name}[{k}]", ktype_)
+ if error_msg is not None:
+ return error_msg
+ error_msg = _type_check(v, f"{name}[{k}]", vtype_)
+ if error_msg is not None:
+ return error_msg
+ return None
+
Review Comment:
need test case in
https://github.com/apache/tvm/blob/main/tests/python/unittest/test_type_annotation_checker.py
--
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]