tensorflow/core/tpu/graph_rewrite/update_tpu_embedding_ops_passes.cc
// Get the enqueue ops and their status (training or eval) from a graph.
// enqueue is a map from a Graph Node* for an enqueue op to a bool which is true
// when the enqueue is part of a TPUEmbedding layer call that contains a send
// gradients.
Get the enqueue ops and their status (training or eval) from a graph.
enqueue is a map from a Graph Node* for an enqueue op to a bool which is true
when the enqueue is part of a TPUEmbedding layer call that contains a send
gradients.
Get the enqueue ops and their status ( training or eval ) from a graph . enqueue is a map from a Graph Node * for an enqueue op to a bool which is true when the enqueue is part of a TPUEmbedding layer call that contains a send gradients .
Status UpdateTPUEmbeddingModePass::GetEnqueueOpsFromGraph(
    Graph* graph, absl::flat_hash_map<Node*, bool>* enqueue) {
  std::map<std::string, Node*> enqueue_op;
  std::map<std::string, bool> found_recv_op;
  std::map<std::string, bool> found_grad_send_op;
  for (Node* node : graph->op_nodes()) {
    TF_RETURN_IF_ERROR(UpdateMapsForModeOverride(
        node->type_string(), node->attrs(), node, &enqueue_op, &found_recv_op,
        &found_grad_send_op));
    node->ClearAttr("_tpu_embedding_layer");
  }
  return ComputeEnqueueTrainingStatus(enqueue_op, found_recv_op,
                                      found_grad_send_op, enqueue);
}
Status UpdateTPUEmbeddingModePass :: GetEnqueueOpsFromGraph ( Graph * graph , absl :: flat_hash_map < Node * , bool > * enqueue ) { std :: map < std :: string , Node * > enqueue_op ; std :: map < std :: string , bool > found_recv_op ; std :: map < std :: string , bool > found_grad_send_op ; for ( Node * node : graph -> op_nodes ( ) ) { TF_RETURN_IF_ERROR ( UpdateMapsForModeOverride ( node -> type_string ( ) , node -> attrs ( ) , node , & enqueue_op , & found_recv_op , & found_grad_send_op ) ) ; node -> ClearAttr ( " " ) ; } return ComputeEnqueueTrainingStatus ( enqueue_op , found_recv_op , found_grad_send_op , enqueue ) ; }
Get the enqueue ops and their status (training or eval) from a graph.
Get the enqueue ops and their status ( training or eval ) from a graph .
// Maps are index by the TPUEmbedding layer's call number. // Clear attribute so any further executions of this pass don't activate // pass.