tensorflow/core/kernels/conditional_accumulator_base.cc
/**
 * Try to flush logged, blocked TakeGrad attempts.
 */
Try to flush logged, blocked TakeGrad attempts.
Try to flush logged blocked TakeGrad attempts .
bool ConditionalAccumulatorBase::TryAttemptLocked(
    std::vector<CleanUp>* clean_up) {
  bool progress = false;
  bool done = false;
  while (!done && !takegrad_attempts_.empty()) {
    if (takegrad_attempts_.front().is_cancelled) {
      VLOG(1) << "Skipping cancelled TakeGrad attempt";
      takegrad_attempts_.pop_front();
    } else {
      Attempt* cur_attempt = &takegrad_attempts_.front();
      switch (cur_attempt->run_callback(cur_attempt)) {
        case kNoProgress:
          done = true;
          break;
        case kComplete:
          progress = true;
          clean_up->emplace_back(std::move(cur_attempt->done_callback),
                                 cur_attempt->cancellation_token,
                                 cur_attempt->context->cancellation_manager());
          takegrad_attempts_.pop_front();
          break;
      }
    }
  }
  return progress;
}
bool ConditionalAccumulatorBase :: TryAttemptLocked ( std :: vector < CleanUp > * clean_up ) { bool progress = false ; bool done = false ; while ( ! done && ! takegrad_attempts_ . empty ( ) ) { if ( takegrad_attempts_ . front ( ) . is_cancelled ) { VLOG ( 1 ) << " " ; takegrad_attempts_ . pop_front ( ) ; } else { Attempt * cur_attempt = & takegrad_attempts_ . front ( ) ; switch ( cur_attempt -> run_callback ( cur_attempt ) ) { case kNoProgress : done = true ; break ; case kComplete : progress = true ; clean_up -> emplace_back ( std :: move ( cur_attempt -> done_callback ) , cur_attempt -> cancellation_token , cur_attempt -> context -> cancellation_manager ( ) ) ; takegrad_attempts_ . pop_front ( ) ; break ; } } } return progress ; }
Try to flush logged, blocked TakeGrad attempts.
Try to flush logged blocked TakeGrad attempts .