Skip to content

Commit a002db1

Browse files
committed
support string and undefined in tobytes()
1 parent 329a798 commit a002db1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/onnx_ir/_core.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,10 @@ def tobytes(self) -> bytes:
512512
}:
513513
# Pack the array into int4
514514
array = _type_casting.pack_4bitx2(array)
515-
else:
515+
elif self.dtype not in {
516+
_enums.DataType.STRING,
517+
_enums.DataType.UNDEFINED,
518+
}:
516519
assert self.dtype.itemsize == array.itemsize, "Bug: The itemsize should match"
517520
if not _IS_LITTLE_ENDIAN:
518521
array = array.view(array.dtype.newbyteorder("<"))

0 commit comments

Comments
 (0)