Merge pull request #18395 from tomoaki0705:fixNativePow

This commit is contained in:
Alexander Alekhin 2020-09-23 18:27:45 +00:00
commit 220b37144b

View File

@ -83,7 +83,7 @@ __kernel void TEMPLATE(lrn_full_no_scale,Dtype)(const int nthreads, __global con
* in_off[(head - size) * step]; * in_off[(head - size) * step];
} }
scale_val = k + accum_scale * alpha_over_size; scale_val = k + accum_scale * alpha_over_size;
out_off[(head - post_pad) * step] = in_off[(head - post_pad) * step] * (Dtype)native_powr((Dtype)scale_val, (Dtype)negative_beta); out_off[(head - post_pad) * step] = in_off[(head - post_pad) * step] * (Dtype)native_powr(scale_val, negative_beta);
++head; ++head;
} }
// subtract only // subtract only
@ -93,7 +93,7 @@ __kernel void TEMPLATE(lrn_full_no_scale,Dtype)(const int nthreads, __global con
* in_off[(head - size) * step]; * in_off[(head - size) * step];
} }
scale_val = k + accum_scale * alpha_over_size; scale_val = k + accum_scale * alpha_over_size;
out_off[(head - post_pad) * step] = in_off[(head - post_pad) * step] * (Dtype)native_powr((Dtype)scale_val, (Dtype)negative_beta); out_off[(head - post_pad) * step] = in_off[(head - post_pad) * step] * (Dtype)native_powr(scale_val, negative_beta);
++head; ++head;
} }
} }