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

Norm op support 2-axis #26492

Merged
merged 13 commits into from
Aug 27, 2020
Merged

Norm op support 2-axis #26492

merged 13 commits into from
Aug 27, 2020

Conversation

yongqiangma
Copy link
Contributor

@yongqiangma yongqiangma commented Aug 20, 2020

PR types

Function optimization

PR changes

OPs

Describe

  1. Norm op suport 2-axis
  2. If axis is None, matrix will be calculated as vector.
    image

@CLAassistant
Copy link

CLAassistant commented Aug 20, 2020

CLA assistant check
All committers have signed the CLA.

@paddle-bot-old
Copy link

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

@paddle-bot-old
Copy link

paddle-bot-old bot commented Aug 20, 2020

✅ This PR's description meets the template requirements!
Please wait for other CI results.

@yongqiangma yongqiangma changed the title Norm Norm op support p=inf and p=-inf Aug 20, 2020
@yongqiangma yongqiangma changed the title Norm op support p=inf and p=-inf Norm op support 2-axis Aug 21, 2020
zhupengyang
zhupengyang previously approved these changes Aug 22, 2020
Copy link
Contributor

@zhupengyang zhupengyang left a comment

Choose a reason for hiding this comment

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

LGTM

python/paddle/tensor/linalg.py Outdated Show resolved Hide resolved
python/paddle/tensor/linalg.py Outdated Show resolved Hide resolved
python/paddle/tensor/linalg.py Outdated Show resolved Hide resolved
python/paddle/tensor/linalg.py Outdated Show resolved Hide resolved
@@ -171,7 +172,7 @@ def __check_input(x, y):
return out


def norm(input, p='fro', axis=None, keepdim=False, out=None, name=None):
def norm(x, p='fro', axis=None, keepdim=False, out=None, 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.

去掉out参数

Copy link
Contributor Author

Choose a reason for hiding this comment

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

去掉out参数

已去掉out参数

@@ -180,14 +181,15 @@ def norm(input, p='fro', axis=None, keepdim=False, out=None, name=None):
or 2-norm, and in general the p-norm for p > 0) of a given tensor.

Args:
input (Variable): The input tensor could be N-D tensor, and the input data
x (Variable): The input tensor could be N-D tensor, and the input data
Copy link
Contributor

Choose a reason for hiding this comment

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

x (Tensor)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

修改为x (Tensor)

@@ -180,14 +181,15 @@ def norm(input, p='fro', axis=None, keepdim=False, out=None, name=None):
or 2-norm, and in general the p-norm for p > 0) of a given tensor.

Args:
input (Variable): The input tensor could be N-D tensor, and the input data
x (Variable): The input tensor could be N-D tensor, and the input data
type could be float32 or float64.
p (float|string, optional): Order of the norm. Supported values are `fro`, `1`, `2`,
Copy link
Contributor

Choose a reason for hiding this comment

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

增加'0'

Copy link
Contributor Author

Choose a reason for hiding this comment

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

注释中增加‘0’

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

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
todo:doc review

Copy link
Contributor

@hong19860320 hong19860320 left a comment

Choose a reason for hiding this comment

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

LGTM

@zhupengyang zhupengyang merged commit e4cc6a2 into PaddlePaddle:develop Aug 27, 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

6 participants