提交 e40905da 编写于 作者: S sneaxiy

Merge branch 'complete_py_reader_python' of https://github.com/sneaxiy/Paddle...

Merge branch 'complete_py_reader_python' of https://github.com/sneaxiy/Paddle into complete_py_reader_python
...@@ -313,8 +313,8 @@ All parameter, weight, gradient are variables in Paddle. ...@@ -313,8 +313,8 @@ All parameter, weight, gradient are variables in Paddle.
}) })
.def("size", &LoDTensorBlockingQueue::Size) .def("size", &LoDTensorBlockingQueue::Size)
.def("capacity", &LoDTensorBlockingQueue::Cap) .def("capacity", &LoDTensorBlockingQueue::Cap)
.def("push_eof", &LoDTensorBlockingQueue::Close) .def("close", &LoDTensorBlockingQueue::Close)
.def("is_eof", &LoDTensorBlockingQueue::IsClosed); .def("is_closed", &LoDTensorBlockingQueue::IsClosed);
m.def("init_lod_tensor_blocking_queue", m.def("init_lod_tensor_blocking_queue",
[](Variable &var, size_t capacity, [](Variable &var, size_t capacity,
......
...@@ -456,7 +456,7 @@ def py_reader(capacity, shapes, lod_levels, dtypes): ...@@ -456,7 +456,7 @@ def py_reader(capacity, shapes, lod_levels, dtypes):
Variable would invoke `pop()` method of the queue to retrieve the Variable would invoke `pop()` method of the queue to retrieve the
feeding data. The process of feeding data in Python side and fetching feeding data. The process of feeding data in Python side and fetching
data in C++ side can run in parallel. The BlockingQueue should be closed data in C++ side can run in parallel. The BlockingQueue should be closed
using `push_eof()` method when unused. using `close()` method when unused.
Args: Args:
capacity(int): The maximum capacity of the BlockingQueue. capacity(int): The maximum capacity of the BlockingQueue.
......
...@@ -81,7 +81,7 @@ class TestPyReader(unittest.TestCase): ...@@ -81,7 +81,7 @@ class TestPyReader(unittest.TestCase):
self.outputs.append( self.outputs.append(
executor.run(fetch_list=list(read_out_data))) executor.run(fetch_list=list(read_out_data)))
feed_queue.push_eof() feed_queue.close()
self.validate() self.validate()
def validate(self): def validate(self):
......
...@@ -184,7 +184,7 @@ class TestPyReaderUsingExecutor(unittest.TestCase): ...@@ -184,7 +184,7 @@ class TestPyReaderUsingExecutor(unittest.TestCase):
fetches = [as_numpy(fetch) for fetch in fetches] fetches = [as_numpy(fetch) for fetch in fetches]
self.outputs.append(fetches) self.outputs.append(fetches)
feed_queue.push_eof() feed_queue.close()
self.validate() self.validate()
def validate(self): def validate(self):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册