-
Notifications
You must be signed in to change notification settings - Fork 5.8k
【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
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
❌ The PR is not created using PR's template. You can refer to this Demo. |
可以同步更新下中文文档 |
test/legacy_test/test_norm_all.py
Outdated
@@ -508,6 +545,15 @@ def test_basic(self): | |||
keep_dim=keep, | |||
check_dim=True, | |||
) | |||
run_nuc( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
单测没有测动态图,需要把动态图、静态图两个分支都测一下
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
test/legacy_test/test_norm_all.py
Outdated
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个直接用np.testing.assert_ 吧,规范一些
test/legacy_test/test_norm_all.py
Outdated
@@ -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): |
There was a problem hiding this comment.
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
test/legacy_test/test_norm_all.py
Outdated
(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( |
There was a problem hiding this comment.
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)吧,清晰规范一点
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里用的np.testing.assert_equal,应该能行吧
test/legacy_test/test_norm_all.py
Outdated
) | ||
|
||
|
||
def run_nuc_graph(self, p, axis, shape_x, dtype, keep_dim, check_dim=False): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
命名参考上面规范一点
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
请提交对应的中文文档修改
Done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR types
Function optimization
PR changes
OPs
Description
为 paddle.linalg.norm 进行功能对齐与功能增强
#60070 (comment)