Skip to content

Conversation

aquagull
Copy link
Contributor

@aquagull aquagull commented Apr 30, 2025

PR Category

User Experience

PR Types

Others

Description

为paddle.max、paddle.min支持 指定axis为非零轴的0-size tensor输入。
以numpy为例

data = np.random.random([0, 2, 3])
res = np.max(data, axis)
  1. axis = (0, )
ValueError: zero-size array to reduction operation maximum which has no identity
  1. 指定 axis = (1, ), keepdims = False
shape:(0, 3), val: []
  1. 指定 axis = (2, ), keepdims = False
shape:(0, 2), val: []
  1. 指定 axis = (1, 2), keepdims = False
shape:(0,), val: []
  1. 指定axis = (2, ), keepdims = True
shape:(0, 2, 1), val: []
  1. 指定axis = (1, ), keepdims = True
shape:(0, 1, 3), val: []

Copy link

paddle-bot bot commented Apr 30, 2025

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@paddle-bot paddle-bot bot added the contributor External developers label Apr 30, 2025
Copy link
Contributor

@HydrogenSulfate HydrogenSulfate left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@HydrogenSulfate HydrogenSulfate merged commit 14e9edc into PaddlePaddle:develop May 27, 2025
48 of 50 checks passed
@aquagull aquagull deleted the min_max branch August 8, 2025 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants