Skip to content

Conversation

@ooooo-create
Copy link
Contributor

在 Paddle 中,如果 axis 为 None,x 会被压缩成一维向量然后计算向量范数。在 pytorch 中 axis为 None,输入可以允许为 1D(向量范数) 或 2D(矩阵范数)。我们只需要将 x flatten 1D 之后传入对应的 torch 函数,if keepdim, reshape 会原来的形状

@paddle-bot
Copy link

paddle-bot bot commented May 28, 2025

Thanks for your contribution!

Copy link
Collaborator

@cangtianhuang cangtianhuang left a comment

Choose a reason for hiding this comment

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

修改后,paddle.linalg.norm 配置是否能够全量通过测试?

@ooooo-create
Copy link
Contributor Author

修改后,paddle.linalg.norm 配置是否能够全量通过测试?

all linalg.norm config in 5_accuracy/accuracy_6.txt and 5_accuracy/accuracy_error_1.txt has passed
图片

Copy link
Collaborator

@cangtianhuang cangtianhuang 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
Collaborator

@wanghuancoder wanghuancoder left a comment

Choose a reason for hiding this comment

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

LGTM

@wanghuancoder wanghuancoder merged commit e29d6d3 into PFCCLab:main May 29, 2025
@luotao1 luotao1 added the HappyOpenSource Pro 进阶版快乐开源活动,更具挑战性的任务 label Jun 10, 2025
@ooooo-create ooooo-create deleted the norm branch September 29, 2025 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor HappyOpenSource Pro 进阶版快乐开源活动,更具挑战性的任务

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants