From 3c5f6106984e9b7809bf7f3af86acf804e62b55e Mon Sep 17 00:00:00 2001 From: Yvonne Chen Date: Tue, 3 Aug 2021 11:41:25 +0200 Subject: [PATCH] add missing saturate in relu quantize compute --- src/caffe/layers/relu_layer.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/caffe/layers/relu_layer.cpp b/src/caffe/layers/relu_layer.cpp index cd89d56e..238ca7a7 100644 --- a/src/caffe/layers/relu_layer.cpp +++ b/src/caffe/layers/relu_layer.cpp @@ -83,6 +83,7 @@ void ReLULayer::Forward_cpu(const vector*>& bottom, if (quant_out) { // do not reuse "top_data"; it is shifted during the computation caffe_cpu_quantize(top[0]->count(), top[0]->mutable_cpu_data(), output_scale_, output_zero_point_); + caffe_cpu_saturate(top[0]->count(), top[0]->mutable_cpu_data(), saturate_); } if (quant_in) { caffe_cpu_quantize(bottom[0]->count(), bottom[0]->mutable_cpu_data(),