测试修复:完善 copy_、trunc_normal_ 和 scale_ 转换规则 - #716
Merged
Conversation
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.
修改内容
paddle.Tensor.copy_增加 composite rule:shape 相同时使用torch.copy_,shape 不同时使用torch.set_,并对齐 Paddle 的 dtype 检查和原地修改语义。paddle.nn.init.trunc_normal_增加 PyTorch 转换规则及默认参数。scale_转换规则,支持整数 Tensor 的scale和bias类型处理。验证
copy_转换矩阵测试通过。copy_accuracy case 全部通过。说明
trunc_normal_属于随机初始化 API,Paddle 和 PyTorch 的随机序列不会逐元素完全一致;本次修改主要补齐 API 转换规则和参数处理。