aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWon Jeon <won.jeon@arm.com>2023-09-15 08:42:28 -0700
committerWon Jeon <won.jeon@arm.com>2023-09-18 08:33:09 -0700
commit924f3094a745c1955d51fce18b488adfed5ee76b (patch)
tree1cdf7a47777a9f685ddbf2dfd7de36546ec877b8
parente7b8eb7f2f8cc61d4f4bef77c2379d3e166a9f37 (diff)
downloadserialization_lib-924f3094a745c1955d51fce18b488adfed5ee76b.tar.gz
Fix numpy deprecation warning message for unsigned int conversion
Signed-off-by: Won Jeon <won.jeon@arm.com> Change-Id: Icac013d42d88534dd1cd71ddb9f47e633a9b51d4
-rw-r--r--python/serializer/tosa_serializer.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/python/serializer/tosa_serializer.py b/python/serializer/tosa_serializer.py
index 220bc2a..bd3a500 100644
--- a/python/serializer/tosa_serializer.py
+++ b/python/serializer/tosa_serializer.py
@@ -460,17 +460,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