diff --git a/paddle/fluid/framework/data_set.cc b/paddle/fluid/framework/data_set.cc index 41129b2596761..b6b9e26792467 100644 --- a/paddle/fluid/framework/data_set.cc +++ b/paddle/fluid/framework/data_set.cc @@ -470,7 +470,6 @@ void DatasetImpl::LoadIntoMemory() { readers_[i]->ResetPathNum(); readers_[i]->ResetEpochFinish(); } - return; } for (int64_t i = 0; i < thread_num_; ++i) { diff --git a/paddle/fluid/pybind/data_set_py.cc b/paddle/fluid/pybind/data_set_py.cc index dc381e6a033e0..bc60d536d19ce 100644 --- a/paddle/fluid/pybind/data_set_py.cc +++ b/paddle/fluid/pybind/data_set_py.cc @@ -290,6 +290,9 @@ void BindDataset(py::module *m) { .def("get_memory_data_size", &framework::Dataset::GetMemoryDataSize, py::call_guard()) + .def("get_epoch_finish", + &framework::Dataset::GetEpochFinish, + py::call_guard()) .def("get_pv_data_size", &framework::Dataset::GetPvDataSize, py::call_guard()) diff --git a/python/paddle/fluid/dataset.py b/python/paddle/fluid/dataset.py index decd3988602ac..b5f6fe4fbcb0c 100644 --- a/python/paddle/fluid/dataset.py +++ b/python/paddle/fluid/dataset.py @@ -945,6 +945,9 @@ def get_pv_data_size(self): """ return self.dataset.get_pv_data_size() + def get_epoch_finish(self): + return self.dataset.get_epoch_finish() + @deprecated( since="2.0.0", update_to="paddle.distributed.InMemoryDataset.get_memory_data_size")