未验证 提交 deb40f06 编写于 作者: S Shang Zhizhou 提交者: GitHub

fix api doc of paddle.any' (#35631)

上级 4e509f46
...@@ -2381,17 +2381,17 @@ def any(x, axis=None, keepdim=False, name=None): ...@@ -2381,17 +2381,17 @@ def any(x, axis=None, keepdim=False, name=None):
out1 = paddle.any(x) # [True] out1 = paddle.any(x) # [True]
print(out1) print(out1)
# out2 should be [True, False] # out2 should be [True, True]
out2 = paddle.any(x, axis=0) # [True, False] out2 = paddle.any(x, axis=0) # [True, True]
print(out2) print(out2)
# keep_dim=False, out3 should be [True, False], out.shape should be (2,) # keep_dim=False, out3 should be [True, True], out.shape should be (2,)
out3 = paddle.any(x, axis=-1) # [True, False] out3 = paddle.any(x, axis=-1) # [True, True]
print(out3) print(out3)
# keep_dim=True, result should be [[True], [False]], out.shape should be (2,1) # keep_dim=True, result should be [[True], [True]], out.shape should be (2,1)
out4 = paddle.any(x, axis=1, keepdim=True) out4 = paddle.any(x, axis=1, keepdim=True)
out4 = paddle.cast(out4, 'int32') # [[True], [False]] out4 = paddle.cast(out4, 'int32') # [[True], [True]]
print(out4) print(out4)
""" """
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册