| 152 | // A helper function that converts a tensor index into a flat array index. |
| 153 | template <int IndexCount> |
| 154 | EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE int TensorIndexToFlat( |
| 155 | const Index<IndexCount>& index, const Dimension<IndexCount>& dims) { |
| 156 | int flat_index = index[0]; |
| 157 | for (int i = 1; i < IndexCount; i++) { |
| 158 | flat_index = flat_index * dims[i] + index[i]; |
| 159 | } |
| 160 | return flat_index; |
| 161 | } |
| 162 | |
| 163 | // A helper function that converts a flat array index into a tensor index. |
| 164 | template <int IndexCount> |
no outgoing calls
no test coverage detected