[WIP][Hackathon 5th No.49][pir] add OpResult.__setitem__
- Part 5
#58739
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
本pr主要是适配
OpResult.__setitem__
(只支持了一个简单写法,更复杂的写法还是会引发段错误)
注:为什么不直接使用
paddle._C_ops.set_value_
替换paddle._legacy_C_ops.set_value_
?因为会在
test/legacy_test/test_set_value_op.py
的TestGradientTruncated.set_value
引发段错误, 暂时还没排查到原因TODO: 在
Parse values
对OpResult
进行处理相关链接:
Tensor
、老IRVariable
、新IROpResult
method 支持对照表 #58118