tensorflow/core/profiler/utils/group_events.cc
bool IsTopRoot(const EventNode* event) {
  if (event->GetGroupId().has_value()) return false;
  for (EventNode* cur = event->GetParent(); cur != nullptr;
       cur = cur->GetParent()) {
    if (cur->IsRoot()) return false;
  }
  return true;
}
// Returns true if none of its ancestors is a root event.
Returns true if none of its ancestors is a root event.
Returns true if none of its ancestors is a root event .
bool IsTopRoot(const EventNode* event) {
  if (event->GetGroupId().has_value()) return false;
  for (EventNode* cur = event->GetParent(); cur != nullptr;
       cur = cur->GetParent()) {
    if (cur->IsRoot()) return false;
  }
  return true;
}
bool IsTopRoot ( const EventNode * event ) { if ( event -> GetGroupId ( ) . has_value ( ) ) return false ; for ( EventNode * cur = event -> GetParent ( ) ; cur != nullptr ; cur = cur -> GetParent ( ) ) { if ( cur -> IsRoot ( ) ) return false ; } return true ; }
Returns true if none of its ancestors is a root event.
Returns true if none of its ancestors is a root event .