From 187af0d41fe75d08d2a7ec84c1b4d24b9b641ed2 Mon Sep 17 00:00:00 2001 From: Won Jeon Date: Fri, 15 Sep 2023 08:42:28 -0700 Subject: Fix numpy deprecation warning message for unsigned int conversion Signed-off-by: Won Jeon Change-Id: Icac013d42d88534dd1cd71ddb9f47e633a9b51d4 --- python/serializer/tosa_serializer.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/serializer/tosa_serializer.py b/python/serializer/tosa_serializer.py index 86ff936..cbef086 100644 --- a/python/serializer/tosa_serializer.py +++ b/python/serializer/tosa_serializer.py @@ -484,17 +484,17 @@ class TosaSerializerTensor: u8_data.append(val_u8) elif self.dtype == DType.INT8: for val in self.data: - val_u8 = np.uint8(val) + val_u8 = np.array(val).astype(dtype=np.uint8) u8_data.append(val_u8) elif self.dtype == DType.INT16: for val in self.data: - val_u16 = np.uint16(val) + val_u16 = np.array(val).astype(dtype=np.uint16) b0 = val_u16 & ByteMask b1 = (val_u16 >> np.uint16(8)) & ByteMask u8_data.extend([b0, b1]) elif self.dtype == DType.INT32: for val in self.data: - val_u32 = np.uint32(val) + val_u32 = np.array(val).astype(dtype=np.uint32) b0 = val_u32 & ByteMask b1 = (val_u32 >> np.uint32(8)) & ByteMask b2 = (val_u32 >> np.uint32(16)) & ByteMask -- cgit v1.2.1