tensorflow/lite/kernels/dynamic_update_slice.cc
// A helper function that converts a tensor index into a flat array index.
// Takes `start_indices` as an offset if not null.
A helper function that converts a tensor index into a flat array index.
Takes `start_indices` as an offset if not null.
A helper function that converts a tensor index into a flat array index . Takes ` start_indices ` as an offset if not null .
int TensorIndexToFlat(const int* index, const int dims,
                      const RuntimeShape& shape,
                      const int* start_indices = nullptr) {
  int flat_index = index[0] + (start_indices ? start_indices[0] : 0);
  for (int i = 1; i < dims; i++) {
    flat_index = flat_index * shape.Dims(i) + index[i] +
                 (start_indices ? start_indices[i] : 0);
  }
  return flat_index;
}
int TensorIndexToFlat ( const int * index , const int dims , const RuntimeShape & shape , const int * start_indices = nullptr ) { int flat_index = index [ 0 ] + ( start_indices ? start_indices [ 0 ] : 0 ) ; for ( int i = 1 ; i < dims ; i ++ ) { flat_index = flat_index * shape . Dims ( i ) + index [ i ] + ( start_indices ? start_indices [ i ] : 0 ) ; } return flat_index ; }
A helper function that converts a tensor index into a flat array index.
A helper function that converts a tensor index into a flat array index .