Skip to content

Commit

Permalink
Removed useless code
Browse files Browse the repository at this point in the history
  • Loading branch information
huangxu96 committed Mar 2, 2022
1 parent 2630074 commit 8853a4e
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions paddle/fluid/operators/sigmoid_cross_entropy_with_logits_op.cu
Original file line number Diff line number Diff line change
Expand Up @@ -125,24 +125,6 @@ struct DivFunctor {
}
};

template <typename T, int BlockDim>
__global__ void Sum(const T *counts, int num, const T eps, T *sum) {
typedef cub::BlockReduce<double, BlockDim> BlockReduce;
__shared__ typename BlockReduce::TempStorage temp_storage;
T in = 0;
for (int i = threadIdx.x; i < num; i += BlockDim) {
in += counts[i];
}
__syncthreads();
auto out =
BlockReduce(temp_storage).Reduce(static_cast<double>(in), cub::Sum());
__syncthreads();
if (threadIdx.x == 0) {
T a = out > eps ? out : eps;
sum[0] = a;
}
}

// Out = max(X, 0) - X * Labels + log(1 + exp(-abs(X)))
template <typename DeviceContext, typename T>
class GPUSigmoidCrossEntropyWithLogitsKernel : public framework::OpKernel<T> {
Expand Down

1 comment on commit 8853a4e

@paddle-bot-old
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Congratulation! Your pull request passed all required CI. You could ask reviewer(s) to approve and merge. 🎉

Please sign in to comment.