From 99d32eb52f1bafc5a27cef1fd262fdce094e2d1f Mon Sep 17 00:00:00 2001 From: whs Date: Mon, 11 Apr 2022 17:14:29 +0800 Subject: [PATCH] Fix fake quant cuda kernel (#41305) (#41588) --- 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