From cf8f65b6944f4537cb33298bd1ee4092d796f802 Mon Sep 17 00:00:00 2001 From: dolphin8 Date: Wed, 24 Oct 2018 13:57:16 +0800 Subject: [PATCH] fix softmax opencl --- src/operators/kernel/cl/cl_kernel/softmax.cl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/operators/kernel/cl/cl_kernel/softmax.cl b/src/operators/kernel/cl/cl_kernel/softmax.cl index 24279e1494..a4514c7064 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; -- GitLab