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

Method RestoreBaseState

tensorflow/core/framework/reader_base.cc:238–264  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

236}
237
238Status ReaderBase::RestoreBaseState(const ReaderBaseState& state) {
239 work_started_ = state.work_started();
240 work_finished_ = state.work_finished();
241 num_records_produced_ = state.num_records_produced();
242 work_ = state.current_work();
243 if (work_started_ < 0 || work_finished_ < 0 || num_records_produced_ < 0) {
244#if defined(__ANDROID__) || defined(__EMSCRIPTEN__)
245 const string debug_string = "<debug state not available>";
246#else
247 const string debug_string = state.DebugString();
248#endif
249 return errors::InvalidArgument(
250 "Unexpected negative value when restoring in ", name(), ": ",
251 debug_string);
252 }
253 if (work_started_ > work_finished_) {
254#if defined(__ANDROID__) || (__EMSCRIPTEN__)
255 const string debug_string = "<debug state not available>";
256#else
257 const string debug_string = state.DebugString();
258#endif
259 return errors::InvalidArgument(
260 "Inconsistent work started vs. finished when restoring in ", name(),
261 ": ", debug_string);
262 }
263 return Status::OK();
264}
265
266} // namespace tensorflow

Callers

nothing calls this directly

Calls 4

InvalidArgumentFunction · 0.85
nameFunction · 0.85
num_records_producedMethod · 0.45
DebugStringMethod · 0.45

Tested by

no test coverage detected