tensorflow/core/tpu/tpu_embedding_configuration_proto_rewrite.cc
// Computes the TPU feature counts per user table as the sum of the TPU feature
// counts of the constituent input features. The TPU feature count for an input
// feature is the ratio of the batch size for that input feature to the batch
// size per TensorCore.
Computes the TPU feature counts per user table as the sum of the TPU feature
counts of the constituent input features. The TPU feature count for an input
feature is the ratio of the batch size for that input feature to the batch
size per TensorCore.
Computes the TPU feature counts per user table as the sum of the TPU feature counts of the constituent input features . The TPU feature count for an input feature is the ratio of the batch size for that input feature to the batch size per TensorCore .
std::vector<int> ComputeTpuFeatureCounts(
    const tpu::TPUEmbeddingConfiguration& config,
    absl::Span<const int> input_feature_batch_sizes,
    int batch_size_per_tensor_core) {
  DCHECK_EQ(input_feature_batch_sizes.size(), config.feature_descriptor_size());
  std::vector<int> tpu_feature_counts(config.table_descriptor_size(), 0);
  for (int i = 0; i < config.feature_descriptor_size(); ++i) {
    DCHECK_EQ(input_feature_batch_sizes[i] % batch_size_per_tensor_core, 0);
    tpu_feature_counts[config.feature_descriptor(i).table_id()] +=
        (input_feature_batch_sizes[i] / batch_size_per_tensor_core);
  }
  return tpu_feature_counts;
}
std :: vector < int > ComputeTpuFeatureCounts ( const tpu :: TPUEmbeddingConfiguration & config , absl :: Span < const int > input_feature_batch_sizes , int batch_size_per_tensor_core ) { DCHECK_EQ ( input_feature_batch_sizes . size ( ) , config . feature_descriptor_size ( ) ) ; std :: vector < int > tpu_feature_counts ( config . table_descriptor_size ( ) , 0 ) ; for ( int i = 0 ; i < config . feature_descriptor_size ( ) ; ++ i ) { DCHECK_EQ ( input_feature_batch_sizes [ i ] % batch_size_per_tensor_core , 0 ) ; tpu_feature_counts [ config . feature_descriptor ( i ) . table_id ( ) ] += ( input_feature_batch_sizes [ i ] / batch_size_per_tensor_core ) ; } return tpu_feature_counts ; }
Computes the TPU feature counts per user table as the sum of the TPU feature
counts of the constituent input features.
Computes the TPU feature counts per user table as the sum of the TPU feature counts of the constituent input features .