diff --git a/src/operators/kernel/cl/cl_kernel/softmax.cl b/src/operators/kernel/cl/cl_kernel/softmax.cl index 24279e149426a95cf8a16c0bc24ad2c4d22c9830..a4514c70640dd6f9582a7362d489f42a58556dcb 100644 --- a/src/operators/kernel/cl/cl_kernel/softmax.cl +++ b/src/operators/kernel/cl/cl_kernel/softmax.cl @@ -40,7 +40,7 @@ __kernel void softmax(__read_only image2d_t input_image, rsum += exp(r - maxv); } - half sum = rsum.x + rsum.y + rsum.z + rsum.w; + float sum = rsum.x + rsum.y + rsum.z + rsum.w; half4 rr = read_imageh(input_image, sampler, (int2)(out_w, out_nh)); half4 result = exp(rr - maxv) / sum;