-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Add mkldnn sigmoid operator #20820
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
Closed
Closed
Add mkldnn sigmoid operator #20820
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
f85f4e3
V1: Initial commit
bddppq 30e24e5
V2: Merge with parent diff changes
bddppq f399a3f
V4: Merge with parent diff changes
bddppq 9cffc6f
V5: Merge with parent diff changes
bddppq 0fc7144
V7: Merge with parent diff changes
bddppq 349a238
V8: Merge with parent diff changes
bddppq 3b83ef6
V9: Merge with parent diff changes
bddppq aba6211
V10: Merge with parent diff changes
bddppq 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 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| #include <ATen/ATen.h> | ||
| #include <ATen/Config.h> | ||
| #include <ATen/NativeFunctions.h> | ||
|
|
||
| #if !AT_MKLDNN_ENABLED() | ||
|
|
||
| namespace at { | ||
| namespace native { | ||
|
|
||
| Tensor mkldnn_sigmoid(const Tensor& self) { | ||
| AT_ERROR("mkldnn_sigmoid: ATen not compiled with MKLDNN support"); | ||
| } | ||
|
|
||
| Tensor& mkldnn_sigmoid_(Tensor& self) { | ||
| AT_ERROR("mkldnn_sigmoid_: ATen not compiled with MKLDNN support"); | ||
| } | ||
|
|
||
| } // namespace native | ||
| } // namespace at | ||
|
|
||
| #else // AT_MKLDNN_EBABLED | ||
|
|
||
| #include <ATen/native/mkldnn/MKLDNNCommon.h> | ||
|
|
||
| namespace at { | ||
| namespace native { | ||
|
|
||
| Tensor mkldnn_sigmoid(const Tensor& self) { | ||
| ideep::tensor& x = itensor_from_mkldnn(self); | ||
| ideep::tensor y; | ||
| ideep::eltwise_forward::compute( | ||
| x, y, ideep::algorithm::eltwise_logistic, ideep::prop_kind::forward); | ||
| return new_with_itensor_mkldnn(std::move(y), self.options()); | ||
| } | ||
|
|
||
| Tensor& mkldnn_sigmoid_(Tensor& self) { | ||
| ideep::tensor& x = itensor_from_mkldnn(self); | ||
| ideep::eltwise_forward::compute( | ||
| x, x, ideep::algorithm::eltwise_logistic, ideep::prop_kind::forward); | ||
| return self; | ||
| } | ||
|
|
||
| } // namespace native | ||
| } // namespace at | ||
|
|
||
| #endif // AT_MKLDNN_EBABLED |
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
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
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.
Uh oh!
There was an error while loading. Please reload this page.