diff options
author | Rickard Bolin <rickard.bolin@arm.com> | 2022-12-19 12:56:17 +0000 |
---|---|---|
committer | Rickard Bolin <rickard.bolin@arm.com> | 2022-12-22 10:24:40 +0000 |
commit | 5fdcf1753fc803a6baeb8eb1fc97c7df5a6e95ac (patch) | |
tree | 77aed7342fdb198b480b16fbd6355cd2d4ba8df3 | |
parent | af1d443159ce12cc03a5721a5db0150ec39d8489 (diff) | |
download | ethos-u-vela-5fdcf1753fc803a6baeb8eb1fc97c7df5a6e95ac.tar.gz |
MLBEDSW-7203: Data type alias deprecations
Deprecation of some data type aliases in NumPy version 1.24.0 caused Vela
to crash when using Python version 3.8 or above. Replaced the deprecated
aliases.
Signed-off-by: Rickard Bolin <rickard.bolin@arm.com>
Change-Id: Ide167ee864a340194ec5e69537c8718192c78ace
-rw-r--r-- | ethosu/vela/architecture_features.py | 4 | ||||
-rw-r--r-- | ethosu/vela/tflite_graph_optimiser.py | 4 | ||||
-rw-r--r-- | ethosu/vela/tflite_mapping.py | 2 | ||||
-rw-r--r-- | ethosu/vela/tosa_mapping.py | 2 |
4 files changed, 6 insertions, 6 deletions
diff --git a/ethosu/vela/architecture_features.py b/ethosu/vela/architecture_features.py index 73dea981..7c0d3117 100644 --- a/ethosu/vela/architecture_features.py +++ b/ethosu/vela/architecture_features.py @@ -593,8 +593,8 @@ class ArchitectureFeatures: self.axi0_port = MemArea(1) self.axi1_port = MemArea(1) self.memory_clock_scales = np.ones(MemArea.Size) - self.memory_burst_length = np.ones(MemArea.Size, np.int) - self.memory_latency = np.zeros((MemArea.Size, BandwidthDirection.Size), np.int) + self.memory_burst_length = np.ones(MemArea.Size, int) + self.memory_latency = np.zeros((MemArea.Size, BandwidthDirection.Size), int) self.const_mem_area = MemPort(1) self.arena_mem_area = MemPort(1) self.cache_mem_area = MemPort(1) diff --git a/ethosu/vela/tflite_graph_optimiser.py b/ethosu/vela/tflite_graph_optimiser.py index 36c1de5a..242f0ea6 100644 --- a/ethosu/vela/tflite_graph_optimiser.py +++ b/ethosu/vela/tflite_graph_optimiser.py @@ -918,8 +918,8 @@ def convert_prelu(op, arch, nng): alpha_zp = alpha.quantization.zero_point alpha_scale = alpha.quantization.scale_f32 # If all alpha values are the same the PReLU can be converted to LeakyRelu - alpha_min = (alpha.values.min().astype(np.int) - alpha_zp) * alpha_scale - alpha_max = (alpha.values.max().astype(np.int) - alpha_zp) * alpha_scale + alpha_min = (alpha.values.min().astype(int) - alpha_zp) * alpha_scale + alpha_max = (alpha.values.max().astype(int) - alpha_zp) * alpha_scale if alpha_min == alpha_max: # or even a Relu if alpha_min == 0: diff --git a/ethosu/vela/tflite_mapping.py b/ethosu/vela/tflite_mapping.py index dd52a3ac..8ec01737 100644 --- a/ethosu/vela/tflite_mapping.py +++ b/ethosu/vela/tflite_mapping.py @@ -201,7 +201,7 @@ datatype_map_numpy = { TensorType.FLOAT16: np.float16, TensorType.FLOAT32: np.float32, TensorType.FLOAT64: np.float64, - TensorType.BOOL: np.bool, + TensorType.BOOL: bool, TensorType.COMPLEX64: np.complex64, TensorType.COMPLEX128: np.complex128, TensorType.STRING: np.uint8, diff --git a/ethosu/vela/tosa_mapping.py b/ethosu/vela/tosa_mapping.py index 87819d6d..97fdd207 100644 --- a/ethosu/vela/tosa_mapping.py +++ b/ethosu/vela/tosa_mapping.py @@ -58,7 +58,7 @@ datatype_map = { } datatype_map_numpy = { - DType.BOOL: np.bool, + DType.BOOL: bool, DType.UINT8: np.uint8, DType.INT8: np.int8, DType.INT16: np.int16, |