diff --git a/compute/tensor/src/cpu/arm/convolution.cpp b/compute/tensor/src/cpu/arm/convolution.cpp index 58755021..c35eebb0 100644 --- a/compute/tensor/src/cpu/arm/convolution.cpp +++ b/compute/tensor/src/cpu/arm/convolution.cpp @@ -351,7 +351,7 @@ EE convolution_infer_forward_tmp_bytes_arm(TensorDesc inputDesc, if (fdt == DT_I8) { *bytes += ic * it * ih * iw; } - if ((odt == DT_I8) || (odt == DT_F32)) { + if (odt != DT_I32) { // scaled bias + results before quantization *bytes += (oc + on * oc * ot * oh * ow) * bytesOf(DT_I32); } diff --git a/model_tools/include/OPOptimizers/QuantizationOptimizer.hpp b/model_tools/include/OPOptimizers/QuantizationOptimizer.hpp index c032a210..8fbf728d 100644 --- a/model_tools/include/OPOptimizers/QuantizationOptimizer.hpp +++ b/model_tools/include/OPOptimizers/QuantizationOptimizer.hpp @@ -219,7 +219,7 @@ class QuantizationOptimizer : public OPOptimizer { bool isNotNaiveRelu(OperatorSpec *op) { - return ((op->type == OT_Relu) && (op->ps.relu_spec.neg_slope != 0)); + return ((op->type == OT_Relu && op->ps.relu_spec.neg_slope != 0) || op->type == OT_Relu6); } bool isAvgPooling(OperatorSpec *op)