| 236 | } |
| 237 | |
| 238 | Status 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 |
nothing calls this directly
no test coverage detected