MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / GetBeginValueAtIndex

Function GetBeginValueAtIndex

tensorflow/lite/kernels/strided_slice.cc:81–88  ·  view source on GitHub ↗

TODO(b/77971377) this logic should be removed, as it's a duplication of StartForAxis() & StopForAxis() in kernels/internal/reference/reference_ops.h

Source from the content-addressed store, hash-verified

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
81inline 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
90inline int32_t GetEndValueAtIndex(StridedSliceContext* op_context, int idx) {
91 const int dim = op_context->input->dims->data[idx];

Callers 1

ResizeOutputTensorFunction · 0.85

Calls 1

ClampedIndexFunction · 0.85

Tested by

no test coverage detected