Skip to content

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



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参数

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)

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.

6 participants