未验证 提交 c8c94799 编写于 作者: X Xin Pan 提交者: GitHub

Merge pull request #13763 from sneaxiy/release/1.0.0

Add comments in `shuffle` and fix 'unstack'
......@@ -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)})
......
......@@ -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',
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册