diff --git a/tensorflow/core/common_runtime/executor.cc b/tensorflow/core/common_runtime/executor.cc index d2e599b04c1..e3a1796dd7a 100644 --- a/tensorflow/core/common_runtime/executor.cc +++ b/tensorflow/core/common_runtime/executor.cc @@ -1603,8 +1603,8 @@ bool MightTrace(const NodeItem& item, } auto* trace_collector = tracing::GetTraceCollector(); if (trace_collector) { - if (using_annotations) { - return trace_collector->IsEnabledForAnnotations(); + if (using_annotations && trace_collector->IsEnabledForAnnotations()) { + return true; } } return profiler::TraceMeRecorder::Active(