Skip to content

Commit 481b6c8

Browse files
committed
fix ci error
1 parent 8d7c83c commit 481b6c8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

python/tvm/runtime/ndarray.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,8 @@ def numpy(self):
213213
np_arr = np.empty(shape, dtype=dtype)
214214
assert np_arr.flags["C_CONTIGUOUS"]
215215
data = np_arr.ctypes.data_as(ctypes.c_void_p)
216-
nbytes = (np_arr.size * old_dtype.bits + 7) // 8
216+
# TODO(kathy): revisit and get a mirrored function of ffi::GetDataSize in Python to replace line below
217+
nbytes = np_arr.size if dtype == "bool" else (np_arr.size * old_dtype.bits + 7) // 8
217218
_ffi_api.TVMArrayCopyToBytes(self, data, nbytes)
218219

219220
if old_dtype == "int4" or old_dtype.startswith("float4_e2m1fn"):

0 commit comments

Comments
 (0)