tensorflow/core/tpu/graph_rewrite/tpu_embedding_software_deduplication_rewrite_pass.cc
// Determines whether any elements in a RewriterConfigsByDevice map contains any
// embedding operations.
Determines whether any elements in a RewriterConfigsByDevice map contains any
embedding operations.
Determines whether any elements in a RewriterConfigsByDevice map contains any embedding operations .
bool RewriterConfigsByDeviceHasEmbeddingOperations(
    const RewriterConfigsByDevice& rewriter_configs_by_device) {
  bool any_embedding_operations = false;
  for (const auto& device_and_rewriter_config : rewriter_configs_by_device) {
    const RewriterConfig& rewriter_config = device_and_rewriter_config.second;
    if (rewriter_config.activations_node_def_name.empty() &&
        rewriter_config.gradients_node_def_name.empty()) {
      continue;
    }
    any_embedding_operations = true;
    break;
  }
  return any_embedding_operations;
}
bool RewriterConfigsByDeviceHasEmbeddingOperations ( const RewriterConfigsByDevice & rewriter_configs_by_device ) { bool any_embedding_operations = false ; for ( const auto & device_and_rewriter_config : rewriter_configs_by_device ) { const RewriterConfig & rewriter_config = device_and_rewriter_config . second ; if ( rewriter_config . activations_node_def_name . empty ( ) && rewriter_config . gradients_node_def_name . empty ( ) ) { continue ; } any_embedding_operations = true ; break ; } return any_embedding_operations ; }
Determines whether any elements in a RewriterConfigsByDevice map contains any
embedding operations.
Determines whether any elements in a RewriterConfigsByDevice map contains any embedding operations .
// Determine if there are any embedding operations in this function, and // skip it if there are none.