don't override display name even if it is empty, otherewise, it could use src->name as dst->display_name.
PiperOrigin-RevId: 315987833
Change-Id: I1904f7f3698f2d7b0f9e8fbe4882c215208c9c95
diff --git a/tensorflow/core/profiler/utils/xplane_utils.cc b/tensorflow/core/profiler/utils/xplane_utils.cc
index ec9428c..6096d71 100644
--- a/tensorflow/core/profiler/utils/xplane_utils.cc
+++ b/tensorflow/core/profiler/utils/xplane_utils.cc
@@ -239,9 +239,8 @@
EnvTime::kNanosToPicos;
}
dst_line.SetNameIfEmpty(line.Name());
- if (!line.DisplayName().empty()) {
- dst_line.SetDisplayNameIfEmpty(line.DisplayName());
- }
+ // Don't override dst_line's display name because if both lines have name,
+ // but no display name, line's name will became display name of dst_line.
}
line.ForEachEvent([&](const tensorflow::profiler::XEventVisitor& event) {