Skip to content

Commit c8c9479

Browse files
authored
Merge pull request #13763 from sneaxiy/release/1.0.0
Add comments in `shuffle` and fix 'unstack'
2 parents 9f0a939 + cff7443 commit c8c9479

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

python/paddle/fluid/layers/io.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -842,6 +842,13 @@ def __create_unshared_decorated_reader__(op_type, reader, attrs, name=None):
842842
def shuffle(reader, buffer_size):
843843
"""
844844
Shuffle the reader.
845+
846+
Args:
847+
reader(Variable): The reader to be decorated with 'shuffling'.
848+
buffer_size(int): The pre-read number of data in :code:`reader`.
849+
850+
Returns:
851+
Variable: The reader which has been decorated with 'shuffling'.
845852
"""
846853
return __create_unshared_decorated_reader__(
847854
'create_shuffle_reader', reader, {'buffer_size': int(buffer_size)})

python/paddle/fluid/layers/nn.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6367,7 +6367,7 @@ def stack(x, axis=0):
63676367
if not isinstance(x, list) and not isinstance(x, tuple):
63686368
x = [x]
63696369

6370-
out = helper.create_tmp_variable(x[0].dtype)
6370+
out = helper.create_tmp_variable(dtype=x[0].dtype)
63716371
helper.append_op(
63726372
type='stack', inputs={'X': x}, outputs={'Y': out},
63736373
attrs={'axis': axis})
@@ -6404,8 +6404,8 @@ def unstack(x, axis=0, num=None):
64046404
num = x.shape[axis]
64056405

64066406
outs = []
6407-
for _ in num:
6408-
outs.append(helper.create_tmp_variable(x.dtype))
6407+
for _ in xrange(num):
6408+
outs.append(helper.create_tmp_variable(dtype=x.dtype))
64096409

64106410
helper.append_op(
64116411
type='unstack',

0 commit comments

Comments
 (0)