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

[Zero-Dim] support 0D output for matrix_rank/multi_dot #52861

Conversation

GGBond8488
Copy link
Contributor

@GGBond8488 GGBond8488 commented Apr 13, 2023

PR types

Others

PR changes

OPs

Describe

support_0D_output_for_matrix_rank_multi_dot
Pcard-66984

@paddle-bot
Copy link

paddle-bot bot commented Apr 13, 2023

你的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.

@GGBond8488 GGBond8488 changed the title 【0D output】support_0D_output_for_matrix_rank_multi_dot, test=allcase 【0D output】support_0D_output_for_matrix_rank_multi_dot Apr 17, 2023
@zhwesky2010 zhwesky2010 changed the title 【0D output】support_0D_output_for_matrix_rank_multi_dot 【0D output】support 0D output for matrix_rank/multi_dot Apr 19, 2023
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.

infoflow 2023-04-19 18-55-24
API文档看起来不太对

@@ -3845,6 +3882,20 @@ def test_unique(self):
self.assertEqual(inverse.shape, [1])
self.assertEqual(counts.shape, [1])

def test_matrix_rank(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

可以测下matrix_rank的第二种用法:

1. tol为float:输入tensor x要求是2维或3维,输出tensor 矩阵的秩为0维(输入2维) 或 1维(输入3维)
2. tol为Tensor:输入x的batch维与tol的形状做广播,得到广播后的shape

@@ -4079,6 +4130,25 @@ def test_unique(self):
self.assertEqual(res[2].shape, (1,))
self.assertEqual(res[3].shape, (1,))

def test_static_matrix_rank(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

和动态图一样可以加个case
命名可以直接test_matrix_rank,加装饰器@prog_scope()

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

@zhwesky2010 zhwesky2010 merged commit 47fa806 into PaddlePaddle:develop Apr 21, 2023
lijialin03 pushed a commit to lijialin03/Paddle that referenced this pull request Apr 25, 2023
…52861)

* support_0D_output_for_matrix_rank_multi_dot, test=allcase

* add 0D output test for matrox_rank and mutli_dot test=allcase

* fix assert error ,test=allcase

* fix test error, test=allcase

* fix other test error, test=allcase

* fix other test error, test=allcase

* fix test error, test=allcase

* fix matrix_rank and multi dot test err test=allcase

* fix test error test=allcase

* fix test zero dim test, test=allcase

* add static backward test for multi_dot, test=allcase

* add tol 2d broadcast test case, test=allcase
@zhwesky2010 zhwesky2010 changed the title 【0D output】support 0D output for matrix_rank/multi_dot [Zero-Dim] support 0D output for matrix_rank/multi_dot May 8, 2023
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.

2 participants