-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
[Zero-Dim] support 0D output for matrix_rank/multi_dot #52861
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
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.
@@ -3845,6 +3882,20 @@ def test_unique(self): | |||
self.assertEqual(inverse.shape, [1]) | |||
self.assertEqual(counts.shape, [1]) | |||
|
|||
def test_matrix_rank(self): |
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.
可以测下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): |
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.
和动态图一样可以加个case
命名可以直接test_matrix_rank,加装饰器@prog_scope()
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
…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
PR types
Others
PR changes
OPs
Describe
support_0D_output_for_matrix_rank_multi_dot
Pcard-66984