!20017 fix type bug in fp16 PReLU grad

Merge pull request !20017 from zhangbuxue/fix_type_bug_in_fp16_PReLU_grad_r1.3
This commit is contained in:
i-robot 2021-07-12 09:54:53 +00:00 committed by Gitee
commit f799fa80ea
1 changed files with 1 additions and 1 deletions

View File

@ -41,7 +41,7 @@ __global__ void InitDwArrayData(size_t dw_array_size, float *dw_array) {
template <typename T>
__global__ void ComputeDwData(size_t weight_size, size_t thread_num, const float *dw_array, T *dw) {
for (size_t i = blockIdx.x * blockDim.x + threadIdx.x; i < weight_size; i += blockDim.x * gridDim.x) {
T value = 0.0;
float value = 0.0;
for (size_t j = 0; j < thread_num; j++) {
value += dw_array[i * thread_num + j];
}