Helper for Split() that returns the shape given a slice index.
| 363 | |
| 364 | // Helper for Split() that returns the shape given a slice index. |
| 365 | static inline int GetSliceShape(const int slice_index, const int split_size, |
| 366 | const int residual) { |
| 367 | DCHECK_GT(split_size, 0); |
| 368 | DCHECK_GE(slice_index, 0); |
| 369 | if (residual == 0) return split_size; |
| 370 | if (slice_index < residual) { |
| 371 | return split_size + 1; |
| 372 | } else { |
| 373 | return split_size; |
| 374 | } |
| 375 | } |
| 376 | |
| 377 | Tensor ix_; |
| 378 | Tensor vals_; |