message: [data-stats] Removes the code which was added to handle nodes generated in first iteration, this has become redundant after the number of iteration of the `tf_data_meta_optimizer` has been set to 1.
diff: @@ -37,8 +37,8 @@ constexpr char kInsertOpName[] = "ExperimentalLatencyStatsDataset";
  NodeDef MakeLatencyNode(const NodeDef& node, MutableGraphView* graph) {
  NodeDef new_node;
  new_node.set_op(kInsertOpName);
  - graph_utils::SetUniqueGraphNodeName(
  - strings::StrCat(kInsertOpName, "_generated"), graph->graph(), &new_node);
  + graph_utils::SetUniqueGraphNodeName(strings::StrCat(kInsertOpName),
  + graph->graph(), &new_node);
  // Set the input of LatencyDataset node as `node`
  new_node.add_input(node.name());
  @@ -75,8 +75,7 @@ Status LatencyAllEdges::OptimizeAndCollectStats(Cluster* cluster,
  // TODO(shivaniagrawal): Add Op to return Latency for the particular Op than
  // for the edge (e2 - e1?).
  for (const NodeDef& node : item.graph.node()) {
  - if (!str_util::EndsWith(node.op(), "Dataset") || node.attr().empty() ||
  - str_util::EndsWith(node.name(), "_generated")) {
  + if (!str_util::EndsWith(node.op(), "Dataset") || node.attr().empty()) {
  // TODO(b/111805951): Replace this with non-approximate way to check if
  // node corresponds to a `Dataset` op.
  continue;
  @@ -87,15 +86,8 @@ Status LatencyAllEdges::OptimizeAndCollectStats(Cluster* cluster,
  if (fanout.size() > 1) {
  LOG(WARNING) << node.name() << " has fanout size " << fanout.size();
  continue;
  - } else { // fanout will have size 0 for last dataset node in the pipeline.
  - if (fanout.size() == 1) {
  - NodeDef* output_node = (*(fanout.begin())).node;
  - if (str_util::EndsWith(output_node->name(), "_generated")) {
  - continue;
  - }
  }
  - }
  -
  + // fanout will have size 0 for last dataset node in the pipeline.
  NodeDef* latency_node = graph.AddNode(MakeLatencyNode(node, &graph));
  TF_RETURN_IF_ERROR(graph.UpdateFanouts(node.name(), latency_node->name()));
  stats->num_changes++;
  