tensorflow/core/profiler/utils/group_events.cc
// Returns true if TF's loop ops exist in the given XSpace's metadata.
Returns true if TF's loop ops exist in the given XSpace's metadata.
Returns true if TF ' s loop ops exist in the given XSpace ' s metadata .
bool CheckLoopOp(const XSpace& space) {
  for (const XPlane& plane : space.planes()) {
    for (const auto& event_metadata : plane.event_metadata()) {
      absl::optional<int64_t> event_type =
          FindHostEventType(event_metadata.second.name());
      if (!event_type.has_value()) continue;
      switch (*event_type) {
        case HostEventType::kWhileOpEvalCond:
        case HostEventType::kWhileOpStartBody:
        case HostEventType::kForOp:
        case HostEventType::kParallelForOp:
        case HostEventType::kForeverOp:
          return true;
        default:
          break;
      }
    }
  }
  return false;
}
bool CheckLoopOp ( const XSpace & space ) { for ( const XPlane & plane : space . planes ( ) ) { for ( const auto & event_metadata : plane . event_metadata ( ) ) { absl :: optional < int64_t > event_type = FindHostEventType ( event_metadata . second . name ( ) ) ; if ( ! event_type . has_value ( ) ) continue ; switch ( * event_type ) { case HostEventType :: kWhileOpEvalCond : case HostEventType :: kWhileOpStartBody : case HostEventType :: kForOp : case HostEventType :: kParallelForOp : case HostEventType :: kForeverOp : return true ; default : break ; } } } return false ; }
Returns true if TF's loop ops exist in the given XSpace's metadata.
Returns true if TF ' s loop ops exist in the given XSpace ' s metadata .