MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle / PickOneFile

Method PickOneFile

paddle/fluid/framework/data_feed.cc:227–245  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

225}
226
227bool DataFeed::PickOneFile(std::string* filename) {
228 PADDLE_ENFORCE_NOT_NULL(
229 mutex_for_pick_file_,
230 common::errors::PreconditionNotMet(
231 "You should call SetFileListMutex before PickOneFile"));
232 PADDLE_ENFORCE_NOT_NULL(
233 file_idx_,
234 common::errors::PreconditionNotMet(
235 "You should call SetFileListIndex before PickOneFile"));
236 std::unique_lock<std::mutex> lock(*mutex_for_pick_file_);
237 VLOG(4) << "filelist_ size: " << filelist_.size();
238 if (*file_idx_ == filelist_.size()) {
239 VLOG(3) << "DataFeed::PickOneFile no more file to pick";
240 return false;
241 }
242 VLOG(3) << "file_idx_=" << *file_idx_;
243 *filename = filelist_[(*file_idx_)++];
244 return true;
245}
246
247void DataFeed::CheckInit() {
248 PADDLE_ENFORCE_EQ(

Callers 5

LoadIntoMemoryMethod · 0.80
LoadIntoMemoryFromSoMethod · 0.80
LoadIntoMemoryByFileMethod · 0.80
LoadIntoMemoryByLineMethod · 0.80

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected