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

Method GetNextWorkLocked

tensorflow/core/framework/reader_base.cc:200–224  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

198}
199
200string ReaderBase::GetNextWorkLocked(QueueInterface* queue,
201 OpKernelContext* context) const {
202 string work;
203 Notification n;
204 queue->TryDequeue(
205 context, [context, &n, &work](const QueueInterface::Tuple& tuple) {
206 if (context->status().ok()) {
207 if (tuple.size() != 1) {
208 context->SetStatus(
209 errors::InvalidArgument("Expected single component queue"));
210 } else if (tuple[0].dtype() != DT_STRING) {
211 context->SetStatus(errors::InvalidArgument(
212 "Expected queue with single string component"));
213 } else if (tuple[0].NumElements() != 1) {
214 context->SetStatus(errors::InvalidArgument(
215 "Expected to dequeue a one-element string tensor"));
216 } else {
217 work = tuple[0].flat<tstring>()(0);
218 }
219 }
220 n.Notify();
221 });
222 n.WaitForNotification();
223 return work;
224}
225
226void ReaderBase::SaveBaseState(ReaderBaseState* state) const {
227 state->Clear();

Callers

nothing calls this directly

Calls 10

InvalidArgumentFunction · 0.85
TryDequeueMethod · 0.45
okMethod · 0.45
statusMethod · 0.45
sizeMethod · 0.45
SetStatusMethod · 0.45
dtypeMethod · 0.45
NumElementsMethod · 0.45
NotifyMethod · 0.45
WaitForNotificationMethod · 0.45

Tested by

no test coverage detected