diff --git a/paddle/fluid/framework/data_set.cc b/paddle/fluid/framework/data_set.cc index baa12950d0d6c..a8b83c710ef51 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 4ed5f32ff3088..f42c179b0a197 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 650cf3756dabb..48efce179da8b 100644 --- a/python/paddle/fluid/dataset.py +++ b/python/paddle/fluid/dataset.py @@ -967,6 +967,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",