this function updates the base indexes with the current index after every single traversal step, can be generalized beyond 2d cases
| 100 | // single traversal step, |
| 101 | // can be generalized beyond 2d cases |
| 102 | void update_base_index(const Tensor &x, vector<int> &traversal_info) { |
| 103 | for (int n = 0; n < (traversal_info[x.shape().size() + 1] + 1); ++n) { |
| 104 | traversal_info[n] = traversal_info[x.shape().size()]; |
| 105 | } |
| 106 | }; |
| 107 | |
| 108 | // function to traverse a const strided tensor object |
| 109 | // it requires an additional vector, traversal_info {0,0,0,0 ...}, comprising |
no test coverage detected