From 6a46c0798e76e6b86ab659fcb36e13d904f7b364 Mon Sep 17 00:00:00 2001 From: yuyang18 Date: Sat, 14 Jul 2018 20:40:41 +0800 Subject: [PATCH] Polish PyReader --- python/paddle/fluid/layers/io.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/python/paddle/fluid/layers/io.py b/python/paddle/fluid/layers/io.py index f4481e1df..08f6d66a6 100644 --- a/python/paddle/fluid/layers/io.py +++ b/python/paddle/fluid/layers/io.py @@ -545,7 +545,11 @@ def py_reader(capacity, reader = monkey_patch_reader_methods(main_prog_var) if use_double_buffer: - reader = double_buffer(reader, name=double_buffer_name) + double_buffer_reader = double_buffer(reader, name=double_buffer_name) + # we return a double buffer reader. However, the reset method comes from + # py_reader. + double_buffer_reader.reset = reader.reset + reader = double_buffer_reader return reader, feed_queue -- GitLab