Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the max, min, maximum, minimum api for the API 2.0 #25580

Merged
merged 12 commits into from
Aug 12, 2020

Conversation

wawltor
Copy link
Contributor

@wawltor wawltor commented Jul 16, 2020

PR types

Bug fixes

PR changes

APIs

Describe

Add the max, min, maximum, minimum api for the API 2.0

@paddle-bot-old
Copy link

Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

import paddle.fluid.core as core


class ApiMaxTest(unittest.TestCase):
Copy link
Contributor

Choose a reason for hiding this comment

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

Min

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed it

import paddle.fluid.core as core


class ApiMaximumTest(unittest.TestCase):
Copy link
Contributor

Choose a reason for hiding this comment

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

Minimum

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed it

user to set this property. For more information, please refer to :ref:`api_guide_Name`

Returns:
Variable: Tensor, results of maximum on the specified dim of input tensor,
Variable: Tensor, results of maximum on the specified axis of input tensor,
Copy link
Contributor

Choose a reason for hiding this comment

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

是否能返回一个二元组,对齐sort和argsort(最大值, indices)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

目前确认不返回index信息

'reduce_all': reduce_all
})
return out


def min(input, dim=None, keep_dim=False, out=None, name=None):
def min(x, axis=None, keepdim=False, name=None):
Copy link
Contributor

Choose a reason for hiding this comment

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

是否能返回一个二元组?对齐sort和argsort(最小值, indices)

XiaoguangHu01
XiaoguangHu01 previously approved these changes Aug 9, 2020
Copy link
Contributor

@XiaoguangHu01 XiaoguangHu01 left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -1116,152 +1219,185 @@ def _check_input(input):
return out


def max(input, dim=None, keep_dim=False, name=None):
def max(x, axis=None, keepdim=False, name=None):
"""
:alias_main: paddle.max
:alias: paddle.max,paddle.tensor.max,paddle.tensor.math.max
Copy link
Contributor

Choose a reason for hiding this comment

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

可以不写alias这两行了 辛苦删掉吧

TCChenlong
TCChenlong previously approved these changes Aug 10, 2020
Copy link
Contributor

@TCChenlong TCChenlong left a comment

Choose a reason for hiding this comment

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

LGTM

@wawltor wawltor dismissed stale reviews from TCChenlong and XiaoguangHu01 via 234ff6b August 10, 2020 09:18
Copy link
Contributor

@TCChenlong TCChenlong left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@FlyingQianMM FlyingQianMM left a comment

Choose a reason for hiding this comment

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

LGTM

@wawltor wawltor merged commit 9c17b3c into PaddlePaddle:develop Aug 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants