We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8d7c83c commit 481b6c8Copy full SHA for 481b6c8
python/tvm/runtime/ndarray.py
@@ -213,7 +213,8 @@ def numpy(self):
213
np_arr = np.empty(shape, dtype=dtype)
214
assert np_arr.flags["C_CONTIGUOUS"]
215
data = np_arr.ctypes.data_as(ctypes.c_void_p)
216
- nbytes = (np_arr.size * old_dtype.bits + 7) // 8
+ # 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
218
_ffi_api.TVMArrayCopyToBytes(self, data, nbytes)
219
220
if old_dtype == "int4" or old_dtype.startswith("float4_e2m1fn"):
0 commit comments