Skip to content

Commit

Permalink
code fix (PaddlePaddle#13365)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bai Yifan authored and qingqing01 committed Sep 13, 2018
1 parent ae67dce commit e69d9c8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion paddle/fluid/operators/softmax_with_cross_entropy_op.cu
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ __global__ void CrossEntropyGrad(T* logit_grad, const int64_t* labels,
for (int i = blockIdx.x * blockDim.x + threadIdx.x; i < batch_size;
i += blockDim.x * gridDim.x) {
int idx = i * class_num + labels[i];
logit_grad[idx] -= static_cast<T>(1.);
logit_grad[idx] -=
ignore_index == labels[i] ? static_cast<T>(0.) : static_cast<T>(1.);
}
}

Expand Down

0 comments on commit e69d9c8

Please sign in to comment.