未验证 提交 b19b01af 编写于 作者: M MRXLT 提交者: GitHub

add dygraph code for unstack (#27881)

上级 2712d076
......@@ -10238,6 +10238,11 @@ def unstack(x, axis=0, num=None):
y = paddle.unstack(x, axis=1) # unstack with second axis, which results 3 tensors with shape=[2, 5]
"""
if in_dygraph_mode():
if num == None:
num = x.shape[axis]
return core.ops.unstack(x, num, 'axis', int(axis), 'num', num)
helper = LayerHelper('unstack', **locals())
if num is None:
if axis is None or x.shape[axis] <= 0:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册