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