tensorflow/core/tpu/graph_rewrite/combine_tpu_embedding_load_retrieve_pass.cc
// Gets single-table retrieve-TPUEmbedding-parameter nodes in the graph.
Gets single-table retrieve-TPUEmbedding-parameter nodes in the graph.
Gets single - table retrieve - TPUEmbedding - parameter nodes in the graph .
absl::flat_hash_set<Node*> GetRetrieveNodes(Graph* graph) {
  const auto retrieve_op_names = GetPerTableRetrieveOptimizationParametersOps();
  auto is_retrieve_op = [&retrieve_op_names](Node* n) {
    return n->IsOp() &&
           std::find(retrieve_op_names.begin(), retrieve_op_names.end(),
                     n->op_def().name()) != retrieve_op_names.end();
  };
  absl::flat_hash_set<Node*> result;
  for (Node* n : graph->nodes()) {
    if (is_retrieve_op(n)) {
      result.insert(n);
    }
  }
  return result;
}
absl :: flat_hash_set < Node * > GetRetrieveNodes ( Graph * graph ) { const auto retrieve_op_names = GetPerTableRetrieveOptimizationParametersOps ( ) ; auto is_retrieve_op = [ & retrieve_op_names ] ( Node * n ) { return n -> IsOp ( ) && std :: find ( retrieve_op_names . begin ( ) , retrieve_op_names . end ( ) , n -> op_def ( ) . name ( ) ) != retrieve_op_names . end ( ) ; } ; absl :: flat_hash_set < Node * > result ; for ( Node * n : graph -> nodes ( ) ) { if ( is_retrieve_op ( n ) ) { result . insert ( n ) ; } } return result ; }
Gets single-table retrieve-TPUEmbedding-parameter nodes in the graph.
Gets single - table retrieve - TPUEmbedding - parameter nodes in the graph .
// Determines whether this node is a per-table retrieve-parameters op.