-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
【Fix PIR Unittest No.38 BUAA】fix TruncatedNormalInitializer according to NormalInitializer and fix test_cuda_random_seed #66413
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
assert not ( | ||
isinstance(var, framework.EagerParamBase) and var.is_dist() | ||
), "Currently, normal initializer not support lazy init for dist param." |
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.
已删除
block = self._check_block(block) | ||
|
||
assert isinstance(var, framework.Variable) |
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.
assert isinstance(var, (framework.Variable, paddle.pir.Value))
这个也应该加上。
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.
assert isinstance(var, (framework.Variable, paddle.pir.core.ParameterMeta))
我打印了一下type(var),发现它是paddle.pir.core.ParameterMeta。
使用assert isinstance(var, (framework.Variable, paddle.pir.Value))过不了
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
… to NormalInitializer and fix test_cuda_random_seed (PaddlePaddle#66413) * fix TruncatedNormalInitializer according to NormalInitializer * change the assertion * fix the code style
… to NormalInitializer and fix test_cuda_random_seed (PaddlePaddle#66413) * fix TruncatedNormalInitializer according to NormalInitializer * change the assertion * fix the code style
… to NormalInitializer and fix test_cuda_random_seed (PaddlePaddle#66413) * fix TruncatedNormalInitializer according to NormalInitializer * change the assertion * fix the code style
PR Category
Others
PR Types
Others
Description
assert isinstance(var, (framework.Variable, paddle.pir.core.ParameterMeta))
assert isinstance(block, (framework.Block, pir.Block))
然后在forward中添加in_pir_mode分支进行pir适配