From 3b4d04936ff7e4657ed95c9a376287a0464c5b5f Mon Sep 17 00:00:00 2001 From: Eta Date: Mon, 25 Nov 2024 14:59:29 -0600 Subject: [PATCH] fix(serialization): Slice 1-D multibyte data as bytes for `pwrite` --- tensorizer/serialization.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tensorizer/serialization.py b/tensorizer/serialization.py index b831bf8..59c3e84 100644 --- a/tensorizer/serialization.py +++ b/tensorizer/serialization.py @@ -3510,7 +3510,7 @@ def _mv_suffix(data: "collections.abc.Buffer", start: int): if not isinstance(data, memoryview): data = memoryview(data) try: - if data.ndim != 1: + if data.ndim != 1 or data.format != "B": data = data.cast("B") return data[start:] finally: