-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Support settiem by Bool index #35133
Conversation
Thanks for your contribution! |
idx = where(item) | ||
gather_val = gather_nd(var, idx) | ||
gather_val_new = value - gather_val | ||
out = scatter_nd_add(var, idx, gather_val_new) |
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.
scatter_nd_add
的API文档上写的支持float32, float64
,这里是否需要做一下类型转换。
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.
这里先设置了类型检查,暂时只支持float32和float64数据类型使用bool索引,后续再根据scatter_nd_add的支持情况进行修改
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
PR types
New features
PR changes
APIs
Describe
Support settiem by Bool index
Example: