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

Method Run

tensorflow/cc/training/queue_runner.cc:162–200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

160}
161
162void QueueRunner::Run(Session* sess, const string& enqueue_op) {
163 bool first_iteration = true;
164 Status status;
165 while (status.ok()) {
166 if (coord_ && coord_->ShouldStop()) {
167 break;
168 }
169 status = RealRun(sess, enqueue_op, true);
170 if (first_iteration) {
171 if (!status.ok()) {
172 mutex_lock l(mu_);
173 enqueue_status_ = status;
174 }
175 counter_->DecrementCount();
176 first_iteration = false;
177 }
178 }
179 bool last_run = false;
180 {
181 mutex_lock l(mu_);
182 runs_--;
183 last_run = (runs_ == 0);
184 }
185
186 // Close the queue unless the coordinator is shutting down since the cancel op
187 // will be run anway in this case.
188 if (IsQueueClosed(status) && (!coord_ || !coord_->ShouldStop())) {
189 if (last_run && !close_op_name_.empty()) {
190 UpdateStatus(RealRun(sess, close_op_name_, false));
191 }
192 } else if (!status.ok()) {
193 LOG(ERROR) << "Queue runner thread got a failure status: "
194 << status.ToString();
195 UpdateStatus(status);
196 if (coord_) {
197 coord_->RequestStop().IgnoreError();
198 }
199 }
200}
201
202Status QueueRunner::GetStatus() {
203 mutex_lock l(mu_);

Callers 7

RealRunMethod · 0.45
TESTFunction · 0.45
ConcurrentStepsFunction · 0.45

Calls 7

RequestStopMethod · 0.80
okMethod · 0.45
ShouldStopMethod · 0.45
DecrementCountMethod · 0.45
emptyMethod · 0.45
ToStringMethod · 0.45
IgnoreErrorMethod · 0.45

Tested by 4

TESTFunction · 0.36