From 330582e24097f68525d4fb56ac76d9c29a0a0068 Mon Sep 17 00:00:00 2001 From: whs Date: Fri, 8 Apr 2022 22:11:17 +0800 Subject: [PATCH] Fix fake quant cuda kernel (#41305) --- paddle/fluid/operators/fake_quantize_op.cu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paddle/fluid/operators/fake_quantize_op.cu.h b/paddle/fluid/operators/fake_quantize_op.cu.h index d85d47f5461..ae448b7ff2c 100644 --- a/paddle/fluid/operators/fake_quantize_op.cu.h +++ b/paddle/fluid/operators/fake_quantize_op.cu.h @@ -305,7 +305,7 @@ __global__ void ChannelClipAndQuantKernelQuantAxisN( int64_t idx = blockDim.x * blockIdx.x + threadIdx.x; for (int64_t i = idx; i < n; i += blockDim.x * gridDim.x) { T s = scale[(i / quant_stride) % nScale]; - T inv_s = 1.0 / s; + T inv_s = inverse(s); T x = in[i]; T v = x > s ? s : x; v = v < -s ? -s : v; -- GitLab