From cff74433cf375f2524e78cf47e9906ff474eb0dd Mon Sep 17 00:00:00 2001 From: sneaxiy Date: Mon, 8 Oct 2018 10:43:42 +0000 Subject: [PATCH] test=release/1.0.0 --- python/paddle/fluid/layers/io.py | 7 +++++++ python/paddle/fluid/layers/nn.py | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/python/paddle/fluid/layers/io.py b/python/paddle/fluid/layers/io.py index d56fa76300..27c9cc3280 100644 --- a/python/paddle/fluid/layers/io.py +++ b/python/paddle/fluid/layers/io.py @@ -842,6 +842,13 @@ def __create_unshared_decorated_reader__(op_type, reader, attrs, name=None): def shuffle(reader, buffer_size): """ Shuffle the reader. + + Args: + reader(Variable): The reader to be decorated with 'shuffling'. + buffer_size(int): The pre-read number of data in :code:`reader`. + + Returns: + Variable: The reader which has been decorated with 'shuffling'. """ return __create_unshared_decorated_reader__( 'create_shuffle_reader', reader, {'buffer_size': int(buffer_size)}) diff --git a/python/paddle/fluid/layers/nn.py b/python/paddle/fluid/layers/nn.py index 8c0ef7a824..dccd57e438 100644 --- a/python/paddle/fluid/layers/nn.py +++ b/python/paddle/fluid/layers/nn.py @@ -6367,7 +6367,7 @@ def stack(x, axis=0): if not isinstance(x, list) and not isinstance(x, tuple): x = [x] - out = helper.create_tmp_variable(x[0].dtype) + out = helper.create_tmp_variable(dtype=x[0].dtype) helper.append_op( type='stack', inputs={'X': x}, outputs={'Y': out}, attrs={'axis': axis}) @@ -6404,8 +6404,8 @@ def unstack(x, axis=0, num=None): num = x.shape[axis] outs = [] - for _ in num: - outs.append(helper.create_tmp_variable(x.dtype)) + for _ in xrange(num): + outs.append(helper.create_tmp_variable(dtype=x.dtype)) helper.append_op( type='unstack', -- GitLab