TODO(b/77971377) this logic should be removed, as it's a duplication of StartForAxis() & StopForAxis() in kernels/internal/reference/reference_ops.h
| 79 | // TODO(b/77971377) this logic should be removed, as it's a duplication of |
| 80 | // StartForAxis() & StopForAxis() in kernels/internal/reference/reference_ops.h |
| 81 | inline int32_t GetBeginValueAtIndex(StridedSliceContext* op_context, int idx) { |
| 82 | const int dim = op_context->input->dims->data[idx]; |
| 83 | const bool pos_stride = GetTensorData<int32_t>(op_context->strides)[idx] > 0; |
| 84 | return op_context->params->begin_mask & (1 << idx) |
| 85 | ? pos_stride ? 0 : dim - 1 |
| 86 | : ClampedIndex(GetTensorData<int32_t>(op_context->begin)[idx], dim, |
| 87 | pos_stride); |
| 88 | } |
| 89 | |
| 90 | inline int32_t GetEndValueAtIndex(StridedSliceContext* op_context, int idx) { |
| 91 | const int dim = op_context->input->dims->data[idx]; |
no test coverage detected