tensorflow/core/kernels/sparse_cross_op.cc
// Extracts data about the features and populates feature data.
Extracts data about the features and populates feature data.
Extracts data about the features and populates feature data .
void ExtractFeatureData(
    const OpInputList& indices_list_in, int64_t batch_size,
    std::vector<std::vector<int64_t>>* feature_counts,
    std::vector<std::vector<int64_t>>* feature_start_indices) {
  gtl::InlinedVector<int64_t, 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_t>();
      int64_t feature_count = 0;
      int64_t 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);
    }
  }
}
void ExtractFeatureData ( const OpInputList & indices_list_in , int64_t batch_size , std :: vector < std :: vector < int64_t > > * feature_counts , std :: vector < std :: vector < int64_t > > * feature_start_indices ) { gtl :: InlinedVector < int64_t , 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_t > ( ) ; int64_t feature_count = 0 ; int64_t 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 ) ; } } }
Extracts data about the features and populates feature data.
Extracts data about the features and populates feature data .
// Loops until we reach next batch index for current feature column.