Skip to content

【Hackathon 5th No.115】为 paddle.linalg.norm 进行功能对齐与功能增强-增加nuclear_norm #60766

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

Merged
merged 5 commits into from
Jan 15, 2024

Conversation

zbt78
Copy link
Contributor

@zbt78 zbt78 commented Jan 11, 2024

PR types

Function optimization

PR changes

OPs

Description

为 paddle.linalg.norm 进行功能对齐与功能增强
#60070 (comment)

Copy link

paddle-bot bot commented Jan 11, 2024

你的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 Jan 11, 2024
Copy link

paddle-bot bot commented Jan 11, 2024

❌ The PR is not created using PR's template. You can refer to this Demo.
Please use PR's template, it helps save our maintainers' time so that more developers get helped.

@luotao1 luotao1 added the HappyOpenSource 快乐开源活动issue与PR label Jan 12, 2024
@luotao1
Copy link
Contributor

luotao1 commented Jan 12, 2024

可以同步更新下中文文档

@@ -508,6 +545,15 @@ def test_basic(self):
keep_dim=keep,
check_dim=True,
)
run_nuc(
Copy link
Contributor

@zhwesky2010 zhwesky2010 Jan 12, 2024

Choose a reason for hiding this comment

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

单测没有测动态图,需要把动态图、静态图两个分支都测一下

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

np_input, axis=axis, keepdims=keep_dim
)
(result,) = exe.run(feed={"X": np_input}, fetch_list=[out])
self.assertEqual((np.abs(result - expected_result) < 1e-6).all(), True)
Copy link
Contributor

Choose a reason for hiding this comment

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

这个直接用np.testing.assert_ 吧,规范一些

@@ -433,6 +446,45 @@ def run_fro(self, p, axis, shape_x, dtype, keep_dim, check_dim=False):
)


def run_nuc(self, p, axis, shape_x, dtype, keep_dim, check_dim=False):
Copy link
Contributor

@zhwesky2010 zhwesky2010 Jan 12, 2024

Choose a reason for hiding this comment

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

这个命名建议规范一点,run_nuc、run_nuc_graph这两个名字改成check_nuc_static、check_nuc_dygraph

(result,) = exe.run(feed={"X": np_input}, fetch_list=[out])
self.assertEqual((np.abs(result - expected_result) < 1e-6).all(), True)
if keep_dim and check_dim:
self.assertEqual(
Copy link
Contributor

Choose a reason for hiding this comment

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

这里直接self.assertEqual(a.shape, b.shape)吧,清晰规范一点

Copy link
Contributor Author

Choose a reason for hiding this comment

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

这里用的np.testing.assert_equal,应该能行吧

)


def run_nuc_graph(self, p, axis, shape_x, dtype, keep_dim, check_dim=False):
Copy link
Contributor

Choose a reason for hiding this comment

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

命名参考上面规范一点

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Contributor

@luotao1 luotao1 left a comment

Choose a reason for hiding this comment

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

请提交对应的中文文档修改

@zbt78
Copy link
Contributor Author

zbt78 commented Jan 15, 2024

请提交对应的中文文档修改

Done.

Copy link
Contributor

@zhwesky2010 zhwesky2010 left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers HappyOpenSource 快乐开源活动issue与PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants