You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by "MasterJH5574 (via GitHub)" <gi...@apache.org> on 2024/03/24 19:56:15 UTC

[PR] [Fix] Fix numpy dtype map [tvm]

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

   NumPy 2.0 removes the dtype `np.float_`, which may introduces compatibility issue for TVM.


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


Re: [PR] [Fix] Fix numpy dtype map [tvm]

Posted by "MasterJH5574 (via GitHub)" <gi...@apache.org>.
MasterJH5574 commented on PR #16780:
URL: https://github.com/apache/tvm/pull/16780#issuecomment-2018526099

   @mshr-h Thank you for the great suggestion! I agree that the way I was doing might not be the best. Feel free to send the change you propose.


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


Re: [PR] [Fix] Fix numpy dtype map [tvm]

Posted by "mshr-h (via GitHub)" <gi...@apache.org>.
mshr-h commented on PR #16780:
URL: https://github.com/apache/tvm/pull/16780#issuecomment-2017574238

   I think this is better.
   ```diff
   -    if np.__version__.startswith("1."):
   -        NUMPY2STR[np.dtype(np.float_)] = "float64"
   +    if hasattr(np, "float_"):
   +        NUMPY2STR[np.dtype(np.float_)] = "float64"
   ```


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


Re: [PR] [Fix] Fix numpy dtype map [tvm]

Posted by "mshr-h (via GitHub)" <gi...@apache.org>.
mshr-h commented on PR #16780:
URL: https://github.com/apache/tvm/pull/16780#issuecomment-2017591582

   This is more Pythonic?
   ```diff
   -    if np.__version__.startswith("1."):
   -        NUMPY2STR[np.dtype(np.float_)] = "float64"
   + try:
   +     NUMPY2STR[np.dtype(np.float_)] = "float64"
   + except AttributeError:
   +     pass
   ```
   
   [LBYL](https://docs.python.org/3/glossary.html#term-LBYL)


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


Re: [PR] [Fix] Fix numpy dtype map [tvm]

Posted by "tqchen (via GitHub)" <gi...@apache.org>.
tqchen merged PR #16780:
URL: https://github.com/apache/tvm/pull/16780


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