Skip to content

Commit

Permalink
Add get_epoch_finish python interface (PaddlePaddle#182)
Browse files Browse the repository at this point in the history
* add get_epoch_finish interface

* add return

* delete return
  • Loading branch information
DesmonDay authored Dec 5, 2022
1 parent b31b242 commit 8b632a2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 0 additions & 1 deletion paddle/fluid/framework/data_set.cc
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,6 @@ void DatasetImpl<T>::LoadIntoMemory() {
readers_[i]->ResetPathNum();
readers_[i]->ResetEpochFinish();
}
return;
}

for (int64_t i = 0; i < thread_num_; ++i) {
Expand Down
3 changes: 3 additions & 0 deletions paddle/fluid/pybind/data_set_py.cc
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,9 @@ void BindDataset(py::module *m) {
.def("get_memory_data_size",
&framework::Dataset::GetMemoryDataSize,
py::call_guard<py::gil_scoped_release>())
.def("get_epoch_finish",
&framework::Dataset::GetEpochFinish,
py::call_guard<py::gil_scoped_release>())
.def("get_pv_data_size",
&framework::Dataset::GetPvDataSize,
py::call_guard<py::gil_scoped_release>())
Expand Down
3 changes: 3 additions & 0 deletions python/paddle/fluid/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 8b632a2

Please sign in to comment.