| 40 | namespace { |
| 41 | |
| 42 | inline void IncrementIndex(std::vector<int64_t>& coord, const std::vector<int64_t>& shape, |
| 43 | const std::vector<int64_t>& axis_order) { |
| 44 | const int64_t ndim = shape.size(); |
| 45 | const int64_t last_axis = axis_order[ndim - 1]; |
| 46 | ++coord[last_axis]; |
| 47 | if (coord[last_axis] == shape[last_axis]) { |
| 48 | int64_t d = ndim - 1; |
| 49 | while (d > 0 && coord[axis_order[d]] == shape[axis_order[d]]) { |
| 50 | coord[axis_order[d]] = 0; |
| 51 | ++coord[axis_order[d - 1]]; |
| 52 | --d; |
| 53 | } |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | // ---------------------------------------------------------------------- |
| 58 | // SparseTensorConverter for SparseCSFIndex |