tensorflow/core/tpu/graph_rewrite/tpu_embedding_software_deduplication_rewrite_pass.cc
// Constructs a NodeDef proto for the _RecvTPUEmbeddingDeduplicationData node to
// be added to the graph or function def.
Constructs a NodeDef proto for the _RecvTPUEmbeddingDeduplicationData node to
be added to the graph or function def.
Constructs a NodeDef proto for the _RecvTPUEmbeddingDeduplicationData node to be added to the graph or function def .
xla::StatusOr<NodeDef> MakeRecvDeduplicationDataNodeDef(
    absl::string_view device_name, absl::string_view tpu_replicate_attr,
    absl::string_view tpu_embedding_config_str,
    absl::Span<const std::string> control_inputs) {
  DeviceNameUtils::ParsedName parsed_name;
  TF_RET_CHECK(DeviceNameUtils::ParseFullName(device_name, &parsed_name));
  NodeDefBuilder builder(
      absl::StrFormat("RecvTPUEmbeddingDeduplicationData_%s_%s_%d",
                      tpu_replicate_attr, parsed_name.type, parsed_name.id),
      "_RecvTPUEmbeddingDeduplicationData");
  if (!device_name.empty()) {
    builder.Device(device_name);
  }
  if (!tpu_replicate_attr.empty()) {
    builder.Attr("_tpu_replicate", tpu_replicate_attr);
  }
  builder.Attr("config", tpu_embedding_config_str);
  for (const std::string& control_input : control_inputs) {
    builder.ControlInput(control_input);
  }
  NodeDef deduplication_data_node_def;
  TF_RETURN_IF_ERROR(builder.Finalize(&deduplication_data_node_def));
  VLOG(1) << "Created new _RecvTPUEmbeddingDeduplicationData node def: "
          << deduplication_data_node_def.DebugString();
  return deduplication_data_node_def;
}
xla :: StatusOr < NodeDef > MakeRecvDeduplicationDataNodeDef ( absl :: string_view device_name , absl :: string_view tpu_replicate_attr , absl :: string_view tpu_embedding_config_str , absl :: Span < const std :: string > control_inputs ) { DeviceNameUtils :: ParsedName parsed_name ; TF_RET_CHECK ( DeviceNameUtils :: ParseFullName ( device_name , & parsed_name ) ) ; NodeDefBuilder builder ( absl :: StrFormat ( " " , tpu_replicate_attr , parsed_name . type , parsed_name . id ) , " " ) ; if ( ! device_name . empty ( ) ) { builder . Device ( device_name ) ; } if ( ! tpu_replicate_attr . empty ( ) ) { builder . Attr ( " " , tpu_replicate_attr ) ; } builder . Attr ( " " , tpu_embedding_config_str ) ; for ( const std :: string & control_input : control_inputs ) { builder . ControlInput ( control_input ) ; } NodeDef deduplication_data_node_def ; TF_RETURN_IF_ERROR ( builder . Finalize ( & deduplication_data_node_def ) ) ; VLOG ( 1 ) << " " << deduplication_data_node_def . DebugString ( ) ; return deduplication_data_node_def ; }
Constructs a NodeDef proto for the _RecvTPUEmbeddingDeduplicationData node to
be added to the graph or function def.
Constructs a NodeDef proto for the _RecvTPUEmbeddingDeduplicationData node to be added to the graph or function def .