-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Move legacy TH functions(sinh,cosh) to TensorIterator + Vec256 #21115
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
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
c2ab94f
changes
xta0 25dd14b
Revert "changes"
xta0 f1cb0cf
udpate
xta0 5666143
update
xta0 b8c9ad1
remove iostream dependency
xta0 ac32913
fix typo
xta0 5f0f89d
remove iostream dependency
xta0 f8adde2
revert unnecessary changes
xta0 b9002c5
revert unnecessary changes
xta0 f680947
remove unnecessary changes
xta0 6159ff4
remove unnecessary changes
xta0 c4fce3e
Merge branch 'dispatch_sinh_cosh' of https://github.com/xta0/pytorch …
xta0 59cee15
remove unnecessary changes
xta0 6e31c50
Merge branch 'dispatch_sinh_cosh' of https://github.com/xta0/pytorch …
xta0 534c06c
remove the IMPLEMENT_UNARY_OP_TH macro
xta0 8f67195
remove the IMPLEMENT_UNARY_OP_TH macro
xta0 85ef253
Merge branch 'dispatch_sinh_cosh' of https://github.com/xta0/pytorch …
xta0 e0d5e1f
remove vectorization
xta0 7fd9709
remove vectorization
xta0 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
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 |
|---|---|---|
|
|
@@ -157,22 +157,6 @@ Tensor& _sigmoid_out_cpu(Tensor& result, const Tensor& self) { | |
| return result; \ | ||
| } | ||
|
|
||
| #define IMPLEMENT_UNARY_OP_TH(op) \ | ||
| Tensor op(const Tensor& self) { \ | ||
| Tensor result = at::empty({0}, self.options()); \ | ||
| at::op##_out(result, self); \ | ||
| return result; \ | ||
| } \ | ||
| Tensor& _##op##__cpu(Tensor& self) { \ | ||
| return at::op##_out(self, self); \ | ||
| } \ | ||
| Tensor& _##op##_out_cpu(Tensor& result, const Tensor& self) { \ | ||
| checkBackend(#op, {result}, Backend::CPU); \ | ||
| assert_no_internal_overlap(result, #op); \ | ||
| result.resize_(self.sizes()); \ | ||
| return legacy::cpu::_th_##op##_out(result, self); \ | ||
| } | ||
|
|
||
| // NB: Temp. defaulting to TH implementation of abs due to issues with Apple | ||
|
|
||
| IMPLEMENT_UNARY_OP_VEC(abs) | ||
|
|
@@ -181,7 +165,7 @@ IMPLEMENT_UNARY_OP_VEC(asin) | |
| IMPLEMENT_UNARY_OP_VEC(atan) | ||
| IMPLEMENT_UNARY_OP_VEC(ceil) | ||
| IMPLEMENT_UNARY_OP_VEC(cos) | ||
| IMPLEMENT_UNARY_OP_TH(cosh) | ||
| IMPLEMENT_UNARY_OP_VEC(cosh) | ||
|
Contributor
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. Can we comment here, that kernels are not using Vec256 (because _VEC is confusing ) |
||
| IMPLEMENT_UNARY_OP_VEC(erf) | ||
| IMPLEMENT_UNARY_OP_VEC(erfc) | ||
| IMPLEMENT_UNARY_OP_VEC(exp) | ||
|
|
@@ -197,7 +181,7 @@ IMPLEMENT_UNARY_OP_VEC(reciprocal) | |
| IMPLEMENT_UNARY_OP_VEC(round) | ||
| IMPLEMENT_UNARY_OP_VEC(rsqrt) | ||
| IMPLEMENT_UNARY_OP_VEC(sin) | ||
| IMPLEMENT_UNARY_OP_TH(sinh) | ||
| IMPLEMENT_UNARY_OP_VEC(sinh) | ||
| IMPLEMENT_UNARY_OP_VEC(sqrt) | ||
| IMPLEMENT_UNARY_OP_VEC(tan) | ||
| IMPLEMENT_UNARY_OP_VEC(tanh) | ||
|
|
@@ -209,6 +193,7 @@ DEFINE_DISPATCH(asin_stub); | |
| DEFINE_DISPATCH(atan_stub); | ||
| DEFINE_DISPATCH(ceil_stub); | ||
| DEFINE_DISPATCH(cos_stub); | ||
| DEFINE_DISPATCH(cosh_stub); | ||
| DEFINE_DISPATCH(erf_stub); | ||
| DEFINE_DISPATCH(erfc_stub); | ||
| DEFINE_DISPATCH(exp_stub); | ||
|
|
@@ -225,6 +210,7 @@ DEFINE_DISPATCH(round_stub); | |
| DEFINE_DISPATCH(rsqrt_stub); | ||
| DEFINE_DISPATCH(sigmoid_stub); | ||
| DEFINE_DISPATCH(sin_stub); | ||
| DEFINE_DISPATCH(sinh_stub); | ||
| DEFINE_DISPATCH(sqrt_stub); | ||
| DEFINE_DISPATCH(tan_stub); | ||
| DEFINE_DISPATCH(tanh_stub); | ||
|
|
||
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.
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.
Can we remove the IMPLEMENT_UNARY_OP_TH macro defined above?
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.
Sounds good.