void ExtractFeatureData(
    const OpInputList& indices_list_in, int64 batch_size,
    std::vector<std::vector<int64>>* feature_counts,
    std::vector<std::vector<int64>>* feature_start_indices) {
  gtl::InlinedVector<int64, 8> current_row(indices_list_in.size(), 0);
  for (int b = 0; b < batch_size; b++) {
    for (int i = 0; i < indices_list_in.size(); i++) {
      const auto indices = indices_list_in[i].matrix<int64>();
      int64 feature_count = 0;
      int64 start_index = current_row[i];
      // Loops until we reach next batch index for current feature column.
      while (current_row[i] < indices_list_in[i].dim_size(0) &&
             indices(current_row[i], 0) == b) {
        feature_count++;
        current_row[i]++;
      }
      (*feature_counts)[i].push_back(feature_count);
      (*feature_start_indices)[i].push_back(start_index);
    }
  }
}
void ExtractFeatureData(
    const OpInputList& indices_list_in, int64 batch_size,
    std::vector<std::vector<int64>>* feature_counts,
    std::vector<std::vector<int64>>* feature_start_indices) {
  gtl::InlinedVector<int64, 8> current_row(indices_list_in.size(), 0);
  for (int b = 0; b < batch_size; b++) {
    for (int i = 0; i < indices_list_in.size(); i++) {
      const auto indices = indices_list_in[i].matrix<int64>();
      int64 feature_count = 0;
      int64 start_index = current_row[i];
       
      while (current_row[i] < indices_list_in[i].dim_size(0) &&
             indices(current_row[i], 0) == b) {
        feature_count++;
        current_row[i]++;
      }
      (*feature_counts)[i].push_back(feature_count);
      (*feature_start_indices)[i].push_back(start_index);
    }
  }
}