Fix bug when input shape is not a multiple of group size.
Fix bug when input shape is not a multiple of group size.

The ring reduce algorithm splits the input tensor.  If the number of elements
is not perfectly divisible by the group size, the last split will get extra
elements.  This change fixes a bug in computing the size of the last split.

PiperOrigin-RevId: 332890377

tensorflow/runtime,tensorflow/runtime,tensorflow/runtime,tensorflow/runtime