Repository navigation
[PIR] Adaptation of test_zero_dim_tensor before TestSundryAPIStatic - #61575
Merged
Merged
Conversation
test_zero_dim_tensor before TestSundryAPIStatic
0x45f
reviewed
Feb 5, 2024
0x45f
reviewed
Feb 6, 2024
SigureMo
reviewed
Feb 7, 2024
SigureMo
reviewed
Feb 7, 2024
Comment on lines
391
to
395
| self.assertEqual(res[0].shape, ()) | ||
| if len(res) > 1: | ||
| self.assertEqual(res[1].shape, ()) | ||
| if len(res) > 2: | ||
| self.assertEqual(res[2].shape, (3, 5)) |
Collaborator
There was a problem hiding this comment.
确认下,这里 PIR 是没跑到么?为啥这里直接用 assertEqual 可以跑过呢?PIR shape 应该是 list
Collaborator
Author
There was a problem hiding this comment.
是的 paddle.any 和 paddle.all 这俩不可微分API 在PIR下没跑到,按理说PIR下是对的,梯度不存在就行,旧IR下是一个全1的矩阵
Collaborator
There was a problem hiding this comment.
这样的话,下个 PR 加一个注释吧,因为单测不应该有这样的不确定性,这对未来退场也是不友好的,可以考虑写成 in_pir_mode 如何,否则如何的形式,根据 len 来判断的话,将来退场是不可能知道要修改这里的
SigureMo
approved these changes
Feb 8, 2024
Comment on lines
391
to
395
| self.assertEqual(res[0].shape, ()) | ||
| if len(res) > 1: | ||
| self.assertEqual(res[1].shape, ()) | ||
| if len(res) > 2: | ||
| self.assertEqual(res[2].shape, (3, 5)) |
Collaborator
There was a problem hiding this comment.
这样的话,下个 PR 加一个注释吧,因为单测不应该有这样的不确定性,这对未来退场也是不友好的,可以考虑写成 in_pir_mode 如何,否则如何的形式,根据 len 来判断的话,将来退场是不可能知道要修改这里的
|
|
||
| # Use to test zero-dim of reduce API | ||
| class TestReduceAPI(unittest.TestCase): | ||
| def assertShapeEqual(self, out, target_tuple): |
Collaborator
There was a problem hiding this comment.
Suggested change
| def assertShapeEqual(self, out, target_tuple): | |
| def assertShapeEqual(self, actual_shape, expected_shape): |
之后可以优化下签名~
This was referenced Feb 19, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

PR types
Others
PR changes
Others
Description
test_zero_dim_*.py#61413