MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / StartLoop

Method StartLoop

tensorflow/core/kernels/functional_ops.cc:583–599  ·  view source on GitHub ↗

If an error e is returned, caller must call Finish(e). If OK is returned, the async loop execution has been started.

Source from the content-addressed store, hash-verified

581 // If an error e is returned, caller must call Finish(e).
582 // If OK is returned, the async loop execution has been started.
583 Status StartLoop() {
584 SetRunOptions(ctx_, &opts_, false /* always_collect_stats */);
585
586 TF_RETURN_IF_ERROR(GetScalar(ctx_, 0, iter_, "start"));
587 TF_RETURN_IF_ERROR(GetScalar(ctx_, 1, &limit_, "limit"));
588 TF_RETURN_IF_ERROR(GetScalar(ctx_, 2, &delta_, "delta"));
589
590 if ((delta_ > 0 && *iter_ <= limit_) ||
591 (delta_ < 0 && *iter_ >= limit_) ||
592 (delta_ == 0 && *iter_ == limit_)) {
593 RunNext();
594 return Status::OK();
595 } else {
596 return errors::InvalidArgument("Invalid start/limit/delta: ", *iter_,
597 " ", limit_, " ", delta_);
598 }
599 }
600
601 void RunNext() {
602 bool done_loop;

Callers

nothing calls this directly

Calls 3

SetRunOptionsFunction · 0.85
InvalidArgumentFunction · 0.85
GetScalarFunction · 0.70

Tested by

no test coverage detected