message: Lite: Slice Op unnecessary reversing of index removed
diff: @@ -78,7 +78,7 @@ template <typename T>
  void GetBeginAndSizeVectors(int dimensions, const TfLiteTensor* begin,
  const TfLiteTensor* size, std::vector<int>* begins,
  std::vector<int>* sizes) {
  - for (int idx = dimensions - 1; idx >= 0; --idx) {
  + for (int idx = 0; idx < dimensions; ++idx) {
  begins->push_back(GetTensorData<T>(begin)[idx]);
  sizes->push_back(GetTensorData<T>(size)[idx]);
  }
  @@ -156,6 +156,11 @@ TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
  std::vector<int> sizes;
  sizes.reserve(kMaxDim);
  + for (int i = NumDimensions(input); i < kMaxDim; ++i) {
  + begins.push_back(0);
  + sizes.push_back(1);
  + }
  +
  if (begin->type == kTfLiteInt32) {
  GetBeginAndSizeVectors<int32_t>(NumDimensions(input), begin, size, &begins,
  &sizes);
  @@ -168,11 +173,6 @@ TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
  return kTfLiteError;
  }
  - for (int i = NumDimensions(input); i < kMaxDim; ++i) {
  - begins.push_back(0);
  - sizes.push_back(1);
  - }
  -
  // The original Slice op implementation only accepted 4-D sizes. That
  // constraint is, for the present, maintained here.
  //
  @@ -187,8 +187,8 @@ TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
  op_params.begin_count = 4; \
  op_params.size_count = 4; \
  for (int i = 0; i < 4; ++i) { \
  - op_params.begin[i] = begins[3 - i]; \
  - op_params.size[i] = sizes[3 - i]; \
  + op_params.begin[i] = begins[i]; \
  + op_params.size[i] = sizes[i]; \
  } \
  \
  if (kernel_type == kGenericOptimized) { \
  