Skip to content

Commit

Permalink
[Fix] Fix numpy dtype map
Browse files Browse the repository at this point in the history
NumPy 2.0 removes the dtype `np.float_`, which may introduces
compatibility issue for TVM.
  • Loading branch information
MasterJH5574 committed Mar 24, 2024
1 parent f14de56 commit 2955bc6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion python/tvm/_ffi/runtime_ctypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,9 @@ class DataType(ctypes.Structure):
np.dtype(np.float16): "float16",
np.dtype(np.float32): "float32",
np.dtype(np.float64): "float64",
np.dtype(np.float_): "float64",
}
if np.__version__.startswith("1."):
NUMPY2STR[np.dtype(np.float_)] = "float64"
STR2DTYPE = {
"void": {"type_code": DataTypeCode.HANDLE, "bits": 0, "lanes": 0},
"bool": {"type_code": DataTypeCode.UINT, "bits": 1, "lanes": 1},
Expand Down

0 comments on commit 2955bc6

Please sign in to comment.