convert lambd directly to scalar_t at hardshrink#9919
Closed
weiyangfb wants to merge 3 commits intopytorch:masterfrom
Closed
convert lambd directly to scalar_t at hardshrink#9919weiyangfb wants to merge 3 commits intopytorch:masterfrom
weiyangfb wants to merge 3 commits intopytorch:masterfrom
Conversation
Contributor
weiyangfb
commented
Jul 27, 2018
- convert lambd directly to scalar_t instead of creating a tensor
ssnl
reviewed
Jul 27, 2018
aten/src/ATen/native/Activation.cpp
Outdated
| scalar_t& self_val, | ||
| scalar_t& out_tensor_val) { | ||
| out_tensor_val = (self_val >= -*lambd_tensor_d && self_val <= *lambd_tensor_d) ? convert<scalar_t, int>(0) : self_val; | ||
| out_tensor_val = (self_val >= -lambd.to<scalar_t>() && self_val <= lambd.to<scalar_t>()) ? convert<scalar_t, int>(0) : self_val; |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
Contributor
facebook-github-bot
left a comment
There was a problem hiding this comment.
weiyangfb has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Contributor
facebook-github-bot
left a comment
There was a problem hiding this comment.
weiyangfb is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
zdevito
pushed a commit
to zdevito/ATen
that referenced
this pull request
Jul 27, 2018
Summary: - convert lambd directly to scalar_t instead of creating a tensor Pull Request resolved: pytorch/pytorch#9919 Differential Revision: D9026708 Pulled By: weiyangfb fbshipit-source-id: d20ab06ecc12aa972ee9d1323ee2f84abf8d5ffd
jramseyer
pushed a commit
to jramseyer/pytorch
that referenced
this pull request
Jul 30, 2018
Summary: - convert lambd directly to scalar_t instead of creating a tensor Pull Request resolved: pytorch#9919 Differential Revision: D9026708 Pulled By: weiyangfb fbshipit-source-id: d20ab06ecc12aa972ee9d1323ee2f84abf8d5ffd
goodlux
pushed a commit
to goodlux/pytorch
that referenced
this pull request
Aug 15, 2018
Summary: - convert lambd directly to scalar_t instead of creating a tensor Pull Request resolved: pytorch#9919 Differential Revision: D9026708 Pulled By: weiyangfb fbshipit-source-id: d20ab06ecc12aa972ee9d1323ee2f84abf8d5ffd
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.