tensorflow/core/tpu/graph_rewrite/tpu_embedding_software_deduplication_rewrite_pass.cc
// Groups the RecvTPUEmbeddingActivations and SendTPUEmbeddingGradients of the
// graph using their _tpu_replicate attribute and requested device.
Groups the RecvTPUEmbeddingActivations and SendTPUEmbeddingGradients of the
graph using their _tpu_replicate attribute and requested device.
Groups the RecvTPUEmbeddingActivations and SendTPUEmbeddingGradients of the graph using their _tpu_replicate attribute and requested device .
Status GroupSendRecvNodesByTpuReplicateAttrAndDevice(
    const Graph* graph, SendRecvNodesMap* send_recv_nodes_map) {
  VLOG(1) << "Grouping nodes by _tpu_replicate attribute";
  for (Node* node : graph->nodes()) {
    if (node->IsOp()) {
      if (node->op_def().name() == "RecvTPUEmbeddingActivations") {
        TF_RETURN_IF_ERROR(
            InsertActivationsNodeIntoMap(node, send_recv_nodes_map));
      } else if (node->op_def().name() == "SendTPUEmbeddingGradients") {
        TF_RETURN_IF_ERROR(
            InsertGradientsNodeIntoMap(node, send_recv_nodes_map));
      }
    }
  }
  return Status::OK();
}
Status GroupSendRecvNodesByTpuReplicateAttrAndDevice ( const Graph * graph , SendRecvNodesMap * send_recv_nodes_map ) { VLOG ( 1 ) << " " ; for ( Node * node : graph -> nodes ( ) ) { if ( node -> IsOp ( ) ) { if ( node -> op_def ( ) . name ( ) == " " ) { TF_RETURN_IF_ERROR ( InsertActivationsNodeIntoMap ( node , send_recv_nodes_map ) ) ; } else if ( node -> op_def ( ) . name ( ) == " " ) { TF_RETURN_IF_ERROR ( InsertGradientsNodeIntoMap ( node , send_recv_nodes_map ) ) ; } } } return Status :: OK ( ) ; }
Groups the RecvTPUEmbeddingActivations and SendTPUEmbeddingGradients of the
graph using their _tpu_replicate attribute and requested device.
Groups the RecvTPUEmbeddingActivations and SendTPUEmbeddingGradients of the graph using their _tpu_replicate attribute and requested device .