tensorflow/core/tpu/graph_rewrite/update_tpu_embedding_ops_passes.cc
// Get the enqueue ops and their status (training or eval) from a function def.
// The enqueue map is indexed by the position of the enqueue op in the
// function's node_def array.
Get the enqueue ops and their status (training or eval) from a function def.
The enqueue map is indexed by the position of the enqueue op in the
function's node_def array.
Get the enqueue ops and their status ( training or eval ) from a function def . The enqueue map is indexed by the position of the enqueue op in the function ' s node_def array .
Status UpdateTPUEmbeddingModePass::GetEnqueueOpsFromFunctionDef(
    FunctionDef* function, std::map<int, bool>* enqueue) {
  std::map<std::string, int> enqueue_op;
  std::map<std::string, bool> found_recv_op;
  std::map<std::string, bool> found_grad_send_op;
  std::string cluster;
  for (int i = 0; i < function->node_def_size(); ++i) {
    const NodeDef& node = function->node_def(i);
    TF_RETURN_IF_ERROR(UpdateMapsForModeOverride(
        node.op(), node, i, &enqueue_op, &found_recv_op, &found_grad_send_op));
    function->mutable_node_def(i)->mutable_attr()->erase(
        "_tpu_embedding_layer");
  }
  return ComputeEnqueueTrainingStatus(enqueue_op, found_recv_op,
                                      found_grad_send_op, enqueue);
}
Status UpdateTPUEmbeddingModePass :: GetEnqueueOpsFromFunctionDef ( FunctionDef * function , std :: map < int , bool > * enqueue ) { std :: map < std :: string , int > enqueue_op ; std :: map < std :: string , bool > found_recv_op ; std :: map < std :: string , bool > found_grad_send_op ; std :: string cluster ; for ( int i = 0 ; i < function -> node_def_size ( ) ; ++ i ) { const NodeDef & node = function -> node_def ( i ) ; TF_RETURN_IF_ERROR ( UpdateMapsForModeOverride ( node . op ( ) , node , i , & enqueue_op , & found_recv_op , & found_grad_send_op ) ) ; function -> mutable_node_def ( i ) -> mutable_attr ( ) -> erase ( " " ) ; } return ComputeEnqueueTrainingStatus ( enqueue_op , found_recv_op , found_grad_send_op , enqueue ) ; }
Get the enqueue ops and their status (training or eval) from a function def.
Get the enqueue ops and their status ( training or eval ) from a function def .
// Clear attribute so any further executions of this pass don't activate // pass.