未验证 提交 330582e2 编写于 作者: W whs 提交者: GitHub

Fix fake quant cuda kernel (#41305)

上级 04a4bdf8
...@@ -305,7 +305,7 @@ __global__ void ChannelClipAndQuantKernelQuantAxisN( ...@@ -305,7 +305,7 @@ __global__ void ChannelClipAndQuantKernelQuantAxisN(
int64_t idx = blockDim.x * blockIdx.x + threadIdx.x; int64_t idx = blockDim.x * blockIdx.x + threadIdx.x;
for (int64_t i = idx; i < n; i += blockDim.x * gridDim.x) { for (int64_t i = idx; i < n; i += blockDim.x * gridDim.x) {
T s = scale[(i / quant_stride) % nScale]; T s = scale[(i / quant_stride) % nScale];
T inv_s = 1.0 / s; T inv_s = inverse(s);
T x = in[i]; T x = in[i];
T v = x > s ? s : x; T v = x > s ? s : x;
v = v < -s ? -s : v; v = v < -s ? -s : v;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册