aboutsummaryrefslogtreecommitdiff
path: root/ethosu/vela/data_type.py
diff options
context:
space:
mode:
authorTim Hall <tim.hall@arm.com>2023-01-13 17:57:25 +0000
committertim.hall <tim.hall@arm.com>2023-01-20 14:07:21 +0000
commit3b1578e44b4c6a8c8c9a8e0891d3866a89bd66af (patch)
tree491c337bc854d435b80f0a535496084ea9ebc9ac /ethosu/vela/data_type.py
parentf34904717f643499f3ea6210322bbe1b635db088 (diff)
downloadethos-u-vela-3b1578e44b4c6a8c8c9a8e0891d3866a89bd66af.tar.gz
MLBEDSW-7151: MLCE: Difference in model output between x86 & aarch64
- The issue is due to undefined behaviour when casting a NumPy float to a NumPy unsigned integer which occurs in create_const_tensor() - The fix is to make sure that the values are first cast to a Python float - In addition, the values datatype argument has been removed from create_const_tensor() to stop the tensor and values datatypes getting out of sync Change-Id: I134b9be8c941b361929a5ae7db8cb35f2e9728f2 Signed-off-by: Tim Hall <tim.hall@arm.com>
Diffstat (limited to 'ethosu/vela/data_type.py')
-rw-r--r--ethosu/vela/data_type.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/ethosu/vela/data_type.py b/ethosu/vela/data_type.py
index 829cef38..5d0320b2 100644
--- a/ethosu/vela/data_type.py
+++ b/ethosu/vela/data_type.py
@@ -1,4 +1,4 @@
-# SPDX-FileCopyrightText: Copyright 2020-2021 Arm Limited and/or its affiliates <open-source-office@arm.com>
+# SPDX-FileCopyrightText: Copyright 2020-2021, 2023 Arm Limited and/or its affiliates <open-source-office@arm.com>
#
# SPDX-License-Identifier: Apache-2.0
#
@@ -110,7 +110,7 @@ class DataType:
BaseType.Complex: "c",
}
assert self.type in numpy_dtype_code, f"Failed to interpret {self} as a numpy dtype"
- return np.dtype(numpy_dtype_code[self.type] + str(self.size_in_bytes()))
+ return np.dtype(numpy_dtype_code[self.type] + str(self.size_in_bytes())).type
stem_name = {
BaseType.UnsignedInt: ("uint%s", True),