提交 db9e700b 编写于 作者: D Dun Liang

default use pin place && test=develop

上级 aa88766a
......@@ -218,7 +218,7 @@ paddle.fluid.layers.shuffle ArgSpec(args=['reader', 'buffer_size'], varargs=None
paddle.fluid.layers.batch ArgSpec(args=['reader', 'batch_size'], varargs=None, keywords=None, defaults=None)
paddle.fluid.layers.double_buffer ArgSpec(args=['reader', 'place', 'name'], varargs=None, keywords=None, defaults=(None, None))
paddle.fluid.layers.random_data_generator ArgSpec(args=['low', 'high', 'shapes', 'lod_levels', 'for_parallel'], varargs=None, keywords=None, defaults=(True,))
paddle.fluid.layers.py_reader ArgSpec(args=['capacity', 'shapes', 'dtypes', 'lod_levels', 'name', 'use_double_buffer', 'use_cuda_pinned_place'], varargs=None, keywords=None, defaults=(None, None, True, None))
paddle.fluid.layers.py_reader ArgSpec(args=['capacity', 'shapes', 'dtypes', 'lod_levels', 'name', 'use_double_buffer'], varargs=None, keywords=None, defaults=(None, None, True))
paddle.fluid.layers.create_py_reader_by_data ArgSpec(args=['capacity', 'feed_list', 'name', 'use_double_buffer'], varargs=None, keywords=None, defaults=(None, True))
paddle.fluid.layers.Preprocessor.__init__ ArgSpec(args=['self', 'reader', 'name'], varargs=None, keywords=None, defaults=(None,))
paddle.fluid.layers.Preprocessor.block ArgSpec(args=[], varargs='args', keywords='kwds', defaults=None)
......
......@@ -483,9 +483,8 @@ def _py_reader(capacity,
lod_levels=None,
name=None,
use_double_buffer=True,
use_cuda_pinned_place=False,
feed_list=None):
use_cuda_pinned_place = use_double_buffer and core.is_compiled_with_cuda()
if feed_list is not None:
if not isinstance(feed_list, list):
raise TypeError("feed_list should be a list of Variable"
......@@ -639,8 +638,7 @@ def py_reader(capacity,
dtypes,
lod_levels=None,
name=None,
use_double_buffer=True,
use_cuda_pinned_place=None):
use_double_buffer=True):
"""
Create a Python reader for data feeding in Python
......@@ -664,9 +662,6 @@ def py_reader(capacity,
name(basestring): The prefix Python queue name and Reader name. None will
be generated automatically.
use_double_buffer(bool): Whether use double buffer or not.
use_cuda_pinned_place(bool): Whether use cuda pinned place or not,
this option only works with double buffer and cuda enabled.
None will be enabled when double buffer and cuda are enabled.
Returns:
Variable: A Reader from which we can get feeding data.
......@@ -762,22 +757,13 @@ def py_reader(capacity,
>>> except fluid.core.EOFException:
>>> test_reader.reset()
"""
if use_double_buffer and core.is_compiled_with_cuda():
if use_cuda_pinned_place == None:
use_cuda_pinned_place = True
else:
if use_cuda_pinned_place:
raise RuntimeError(
"use_cuda_pinned_place can only be used with double buffer and cuda enabled."
)
return _py_reader(
capacity=capacity,
shapes=shapes,
dtypes=dtypes,
lod_levels=lod_levels,
name=name,
use_double_buffer=use_double_buffer,
use_cuda_pinned_place=use_cuda_pinned_place)
use_double_buffer=use_double_buffer)
def create_py_reader_by_data(capacity,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册