Repository navigation
[PIR] Adaptation of test_zero_dim_tensor TestSundryAPIStatic - #61577
Merged
Merged
Conversation
test_zero_dim_tensor TestSundryAPIStatic
0x45f
reviewed
Feb 5, 2024
0x45f
reviewed
Feb 6, 2024
| res = self.exe.run(prog, fetch_list=[x, out] + grad_list) | ||
| self.assertEqual(res[0].shape, ()) | ||
| self.assertEqual(res[1].shape, ()) | ||
| if len(grad_list) > 0: |
Collaborator
There was a problem hiding this comment.
这里的判断是说len(grad_list)可能==0吗,grad_list的元素个数为什么会变呢?
Collaborator
Author
Collaborator
There was a problem hiding this comment.
因为有时候梯度为 None, 所以数量会变
单测应该是确定的事情,如果这里确实不应该有梯度,那么就应该 assert 是 None
可以看看老 IR 下是不是 None 呢?
Collaborator
Author
Collaborator
There was a problem hiding this comment.
那就是新老 IR 无法对齐咯,这里如果方便的话,可以定位下问题,建议单独 PR 处理~
SigureMo
reviewed
Feb 6, 2024
| res = self.exe.run(prog, fetch_list=[x, out] + grad_list) | ||
| self.assertEqual(res[0].shape, ()) | ||
| self.assertEqual(res[1].shape, ()) | ||
| if len(grad_list) > 0: |
Collaborator
There was a problem hiding this comment.
因为有时候梯度为 None, 所以数量会变
单测应该是确定的事情,如果这里确实不应该有梯度,那么就应该 assert 是 None
可以看看老 IR 下是不是 None 呢?
SigureMo
approved these changes
Feb 7, 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