-
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
add index_put api #52886
Merged
Xreki
merged 28 commits into
PaddlePaddle:develop
from
Courtesy-Xs:clear_add_index_put_api
May 10, 2023
Merged
add index_put api #52886
Changes from 16 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
21c5464
add index_put api
Courtesy-Xs a75ded8
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
Courtesy-Xs 91c30e6
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
Courtesy-Xs 9da71b6
fix some bugs
Courtesy-Xs 4538c1a
fix value broadcast in backward and add test case in static
Courtesy-Xs 244d02d
fix cpu backward bug
Courtesy-Xs 01672f8
add timeout=120s for index_put
Courtesy-Xs 5a361ea
add op_compat for index_put
Courtesy-Xs a7f2d42
delete input_put in op_compat.yaml
Courtesy-Xs d996d36
add inplace index_put test
Courtesy-Xs 8a3fef4
refactor code
Courtesy-Xs 5f77bb5
add test case when index tensor in indices is int32 when indices.size…
Courtesy-Xs 6267d32
add index_put api backward in cpu place
Courtesy-Xs fdd0436
add backward test case
Courtesy-Xs 86d6cac
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
Courtesy-Xs 7b71a3a
fix take in init.py bug
Courtesy-Xs 48a03c6
refactor code according to review result
Courtesy-Xs 9b2d455
alter 2022 to 2023 in copyright declaration
Courtesy-Xs 0c6545a
refactor code to delete some duplicated code
Courtesy-Xs 894adb1
replaace reshape with resize for decrease extra memcpy
Courtesy-Xs ed7a141
add datatype flag in backward yaml
Courtesy-Xs c92f75e
replace macro with template with conditional complilation
Courtesy-Xs 4de9b48
fix rocmn bug
Courtesy-Xs ed00d81
fix note and rocmn bug
Courtesy-Xs f956aee
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
Courtesy-Xs 43167ab
fix conflict between flatten and index_put
Courtesy-Xs b09221f
fix bug in documentation
Courtesy-Xs db0209f
Update python/paddle/tensor/manipulation.py
Ligoml File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3249,6 +3249,21 @@ void MoeInferMeta(const MetaTensor& x, | |
out->set_layout(x.layout()); | ||
} | ||
|
||
void IndexPutInferMeta(const MetaTensor& x, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. InferMeta按照字母序放置 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
const std::vector<const MetaTensor*>& indices, | ||
const MetaTensor& value, | ||
bool accumulate, | ||
MetaTensor* out) { | ||
auto in_dims = x.dims(); | ||
PADDLE_ENFORCE_LT( | ||
in_dims.size(), | ||
7, | ||
phi::errors::InvalidArgument( | ||
"The rank of input should be less than 7, but received %d.", | ||
in_dims.size())); | ||
out->share_meta(x); | ||
} | ||
|
||
void WeightedSampleNeighborsInferMeta(const MetaTensor& row, | ||
const MetaTensor& col_ptr, | ||
const MetaTensor& edge_weight, | ||
|
@@ -3295,6 +3310,5 @@ void WeightedSampleNeighborsInferMeta(const MetaTensor& row, | |
out_count->set_dims({-1}); | ||
out_count->set_dtype(DataType::INT32); | ||
} | ||
|
||
} // namespace phi | ||
PD_REGISTER_INFER_META_FN(batch_norm_infer, phi::BatchNormInferInferMeta); |
This file contains 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
Oops, something went wrong.
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.
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.
输入x和indices的数据类型不同,需要指定按照谁的数据类型来选择kernel,关键字为
data_type
,写法如后面紧跟的index_sample
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