cconvey commented on code in PR #12168:
URL: https://github.com/apache/tvm/pull/12168#discussion_r929184800
##########
tests/python/contrib/test_hexagon/pytest_util.py:
##########
@@ -109,25 +113,32 @@ def get_multitest_ids(
]
-def get_numpy_dtype_info(np_dtype_name: str) -> Union[np.finfo, np.iinfo]:
+def get_numpy_dtype_info(dtype: Union[str, np.dtype]) -> Union[np.finfo,
np.iinfo]:
"""
Return an appropriate 'np.iinfo' or 'np.finfo' object corresponding to
- the specified dtype.
+ the specified Numpy dtype.
"""
- np_dtype = np.dtype(np_dtype_name)
+
+ if type(dtype) == str:
Review Comment:
Good idea. I put the assert there because AFAIK Python `typing` typically
isn't checked at runtime. So I put the assertion there to help detect such
problems.
But in retrospect, that's not particularly idiomatic. I'll just delete the
assert.
--
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]