| 33 | } |
| 34 | |
| 35 | TensorShape ReductionHelper::shuffled_shape() { |
| 36 | const int dims = data_reshape_.size(); |
| 37 | TensorShape shape; |
| 38 | for (int i = reduce_first_axis_; i < dims; i += 2) { |
| 39 | shape.AddDim(data_reshape_[i]); |
| 40 | } |
| 41 | for (int i = !reduce_first_axis_; i < dims; i += 2) { |
| 42 | shape.AddDim(data_reshape_[i]); |
| 43 | } |
| 44 | return shape; |
| 45 | } |
| 46 | |
| 47 | gtl::InlinedVector<int32, 8> ReductionHelper::permutation() { |
| 48 | const int dims = data_reshape_.size(); |