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
This commit is contained in:
A. Unique TensorFlower 2020-06-11 15:14:59 -07:00 committed by TensorFlower Gardener
parent 2bd19c69ae
commit 17b422ffc8

View File

@ -239,9 +239,8 @@ void MergePlanes(const XPlane& src_plane, XPlane* dst_plane) {
EnvTime::kNanosToPicos; EnvTime::kNanosToPicos;
} }
dst_line.SetNameIfEmpty(line.Name()); dst_line.SetNameIfEmpty(line.Name());
if (!line.DisplayName().empty()) { // Don't override dst_line's display name because if both lines have name,
dst_line.SetDisplayNameIfEmpty(line.DisplayName()); // but no display name, line's name will became display name of dst_line.
}
} }
line.ForEachEvent([&](const tensorflow::profiler::XEventVisitor& event) { line.ForEachEvent([&](const tensorflow::profiler::XEventVisitor& event) {