diff --git a/python/paddle/fluid/layers/io.py b/python/paddle/fluid/layers/io.py index d56fa76300e7054ef71a7729483a579fa35f1dac..27c9cc3280b332cd9aeb0169a1ec0c06b2a8647e 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 8c0ef7a82421ffc04bf669e6850e075226c09d27..dccd57e438133fac5e4ab7da335fb31a7bb68ea9 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',