未验证 提交 1b9aee4f 编写于 作者: L Liyulingyue 提交者: GitHub

Update manipulation.py (#40722)

上级 a57a4907
......@@ -889,12 +889,20 @@ def stack(x, axis=0, name=None):
x1 = paddle.to_tensor([[1.0, 2.0]])
x2 = paddle.to_tensor([[3.0, 4.0]])
x3 = paddle.to_tensor([[5.0, 6.0]])
out = paddle.stack([x1, x2, x3], axis=0)
print(out.shape) # [3, 1, 2]
print(out)
# [[[1., 2.]],
# [[3., 4.]],
# [[5., 6.]]]
out = paddle.stack([x1, x2, x3], axis=-2)
print(out.shape) # [1, 3, 2]
print(out)
# [[[1., 2.],
# [3., 4.],
# [5., 6.]]]
"""
return layers.stack(x, axis, name)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册