[WIP] Implemented hardshrink in ATen with cuda#7695
Closed
weiyangfb wants to merge 3 commits intopytorch:masterfrom
Closed
[WIP] Implemented hardshrink in ATen with cuda#7695weiyangfb wants to merge 3 commits intopytorch:masterfrom
weiyangfb wants to merge 3 commits intopytorch:masterfrom
Conversation
implement hardshrink with CPU/CUDA_tensor_apply*, similar performance as nn.Hardshrink
…eter for Scalar lambda
zou3519
reviewed
May 21, 2018
| const scalar_t& lambda_t_val, | ||
| const scalar_t& zero_t_val) { | ||
| if (out_t_val >= -lambda_t_val && out_t_val <= lambda_t_val) { | ||
| out_t_val = zero_t_val; |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
zou3519
reviewed
May 21, 2018
| res = torch.LongTensor((-bignumber,)) | ||
| self.assertGreater(res.abs()[0], 0) | ||
|
|
||
| def test_hardshrink(self): |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
Collaborator
|
Any updates on this? |
Contributor
Author
|
For some reasons the compilation of this branch is not working correctly for me. One thing might be related to this was at some point I tried to build using a different version of python. I will close this and create a new PR. |
Contributor
Author
Collaborator
|
@weiyangfb Not necessary, but it shouldn't be too hard, right? |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary:
=> 1 loop, best of 3: 3.99 s per loop
=> 1 loop, best of 3: 4.04 s per loop
=> 1 loop, best of 3: 10 s per loop
=> 1 loop, best of 3: 7.78 s per loop
TODO: