-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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 clip op #3937
Merged
+262
−0
Merged
Add clip op #3937
Changes from 1 commit
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
987cdf1
Add clip op
wanghaoshuang 320df7a
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
wanghaoshuang 6e964ad
Fix issues
wanghaoshuang 2321a37
fix issues
wanghaoshuang a345b71
1. Add CUDA stream when launching kernel.
wanghaoshuang 3102a52
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
wanghaoshuang 44224f4
remove gradient_checker.py
wanghaoshuang a3c3b78
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
wanghaoshuang 14fb15b
Remove const cast for device context
wanghaoshuang 743dfd8
Add nullptr check
wanghaoshuang 2cde56c
Use Transform instead of eigen
wanghaoshuang 3f3848c
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
wanghaoshuang 1fdad1a
Update transform invocation
wanghaoshuang c7b6d2c
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
wanghaoshuang 1244050
Fix some inssues
wanghaoshuang 9569255
Fix ptr type
wanghaoshuang 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
Fix issues
- v3.0.0-rc1
- v3.0.0-rc0
- v3.0.0-beta2
- v3.0.0-beta1
- v3.0.0-beta0
- v2.6.2
- v2.6.1
- v2.6.0
- v2.6.0-bak0
- v2.5.2
- v2.5.1
- v2.5.0
- v2.5.0-rc1
- v2.5.0-rc0
- v2.4.2
- v2.4.1
- v2.4.0
- v2.4.0-rc0
- v2.3.2
- v2.3.1
- v2.3.0
- v2.3.0-rc0
- v2.2.2
- v2.2.1
- v2.2.0
- v2.2.0-rc0
- v2.2.0-bak0
- v2.1.3
- v2.1.2
- v2.1.1
- v2.1.0
- v2.1.0-rc0
- v2.0.2
- v2.0.1
- v2.0.0
- v2.0.0-rc1
- v2.0.0-rc0
- v2.0.0-beta0
- v2.0.0-alpha0
- v1.8.5
- v1.8.4
- v1.8.3
- v1.8.2
- v1.8.1
- v1.8.0
- v1.7.2
- v1.7.1
- v1.7.0
- v1.6.3
- v1.6.2
- v1.6.1
- v1.6.0
- v1.6.0-rc0
- v1.5.2
- v1.5.1
- v1.5.0
- v1.4.1
- v1.4.0
- v1.3.2
- v1.3.1
- v1.3.0
- v1.2.1
- v1.2.0
- v1.1.0
- v1.0.2
- v1.0.1
- v1.0.0
- v1.0.0-rc0
- v0.15.0
- v0.15.0-rc0
- v0.14.0
- v0.13.0
- v0.12.0
- v0.11.1a2
- v0.11.1a1
- v0.11.0
- lite-v0.1
commit 6e964ad5cbce4c0c9a4f2365aaac0905e6ecf71a
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,8 +34,8 @@ template <typename T> | |
class ClipGradientOpCUDAKernel : public framework::OpKernel { | ||
public: | ||
void Compute(const framework::ExecutionContext& context) const override { | ||
auto max = context.op().GetAttr<float>("max"); | ||
auto min = context.op().GetAttr<float>("min"); | ||
auto max = context.op().Attr<float>("max"); | ||
auto min = context.op().Attr<float>("min"); | ||
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.
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. Fixed. |
||
auto* d_out = context.Input<Tensor>(framework::GradVarName("Out")); | ||
auto* d_x = context.Output<Tensor>(framework::GradVarName("X")); | ||
auto* x = context.Output<Tensor>("X"); | ||
|
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
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.
Output< framework::LoDTensor>
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.
Fixed.