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
New features
PR changes
OPs
Description
增加XPU下面的
squared_l2_norm
算子及其反向squared_l2_norm_grad
。注1:在现有版本的
python/paddle/nn/clip.py
中,当使用的设备是XPU时,会走“基础算子实现”。本PR加了squared_l2_norm
算子,因此可以去掉这个单独的if
语句。注2:最近XDNN中刚刚增加了
squared_l2_norm
算子的bfloat16实现,但是暂时还没有稳定产出,因此本PR只支持float和float16两种类型。后续再增加bfloat16类型。