New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
【Hackathon 5th No.4】为 Paddle 新增 masked_scatter API RFC #629
【Hackathon 5th No.4】为 Paddle 新增 masked_scatter API RFC #629
Conversation
…to masked_scatter_rfc
…to masked_scatter_rfc
…to masked_scatter_rfc
…to masked_scatter_rfc
…to masked_scatter_rfc
@zoooo0820 老师我重新提交了一版RFC,麻烦您抽空看看 |
…to masked_scatter_rfc
@zoooo0820 麻烦review一下 |
…to masked_scatter_rfc
…to masked_scatter_rfc
@zoooo0820 老师您看还有问题吗 |
|
||
### masked_scatter的初步实现 | ||
|
||
初步实现如下: |
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.
这部分初步实现的想法可以搬运到下面API实现方案
中
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.
Done
return paddle.index_put(x, indexs, value.flatten()[:mask.sum()]) | ||
else: | ||
""" | ||
经过测试,静态图模式下(当x的shape中含有-1)broasdcast_to广播操作失效。但是可以借助乘法来间接实现广播效果 |
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.
Done
|
||
Tensor.masked_scatter(mask, value) | ||
|
||
Tensor.masked_scatter_(mask, 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.
函数签名中需要补充name=None
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.
Done
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.
@zoooo0820 已全部修改
…to masked_scatter_rfc
…ommunity into masked_scatter_rfc
@zoooo0820 @luotao1 麻烦帮忙看看还有问题吗 |
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
No description provided.