Skip to content

Commit

Permalink
Fix formatting in segment_reduction_ops_gpu.cu.h
Browse files Browse the repository at this point in the history
  • Loading branch information
benbarsdell committed Aug 10, 2021
1 parent 96ac56c commit 1988dd4
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions tensorflow/core/kernels/segment_reduction_ops_gpu.cu.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ DEFINE_REDUCE_UPDATE_OP_GPU(NonAtomicMin, *dest = min(*dest, value))
#undef DEFINE_REDUCE_UPDATE_OP_GPU

template <typename ReduceOp>
struct ReduceUpdateOpFor {
};
struct ReduceUpdateOpFor {};

#define DEFINE_REDUCE_UPDATE_OP_FOR(reduce_op, atomic, nonatomic) \
template <> \
Expand Down Expand Up @@ -144,11 +143,11 @@ __global__ void SegmentMeanNormalizeKernel(
SegmentId nsegments, Index ninner,
const Index* __restrict__ segment_offsets, // [nsegments + 1]
T* __restrict__ output) { // [nsegments, ninner]
for(SegmentId seg : GpuGridRangeY(nsegments)) {
for (SegmentId seg : GpuGridRangeY(nsegments)) {
SegmentId segment_size = segment_offsets[seg + 1] - segment_offsets[seg];
segment_size = max(segment_size, Index(1)); // Avoid division by zero
T inv_norm = T(1) / static_cast<T>(segment_size);
for(Index i : GpuGridRangeX(ninner)) {
for (Index i : GpuGridRangeX(ninner)) {
output[seg * ninner + i] *= inv_norm;
}
}
Expand Down

0 comments on commit 1988dd4

Please sign in to comment.