MLBEDSW-4974: create_const_tensor invalid argument
- Fix bug with MEAN ops calling create_const_tensor using the
quant_value_dtype keyword argument.
Signed-off-by: Tim Hall <tim.hall@arm.com>
Change-Id: I8cff542ae840fb110ea97c0cc86bb761d5a884d3
diff --git a/ethosu/vela/tflite_graph_optimiser.py b/ethosu/vela/tflite_graph_optimiser.py
index 68b4e8e..2959803 100644
--- a/ethosu/vela/tflite_graph_optimiser.py
+++ b/ethosu/vela/tflite_graph_optimiser.py
@@ -1515,13 +1515,7 @@
bias_shape = [shape[-1]]
op.set_input_tensor(
create_const_tensor(
- "bias",
- bias_shape,
- inp.dtype,
- np.ones(bias_shape) * bias,
- value_dtype=np.int32,
- quant_value_dtype=np.int32,
- quantization=None,
+ "bias", bias_shape, inp.dtype, np.ones(bias_shape) * bias, value_dtype=np.int32, quantization=None,
),
2,
)
diff --git a/ethosu/vela/tflite_supported_operators.py b/ethosu/vela/tflite_supported_operators.py
index cb3d504..dc4e6f0 100644
--- a/ethosu/vela/tflite_supported_operators.py
+++ b/ethosu/vela/tflite_supported_operators.py
@@ -386,7 +386,7 @@
"Optional Bias tensor values must fit within 40-bits"
bias = op.bias
if bias and bias.dtype == DataType.int64 and bias.values is not None:
- valid = all(len(bin(quant_value)[2:]) <= 40 for quant_value in bias.values)
+ valid = all(len(bin(value)[2:]) <= 40 for value in bias.values)
return valid, f"Tensor '{bias.name}' has values larger than 40-bits"
return True, "Op has no bias tensor, or it fits in 40-bit"