Skip to content

Commit 7767dcf

Browse files
soulitzerfacebook-github-bot
authored andcommitted
Revert D25564477: [pytorch][PR] Add sinc operator
Test Plan: revert-hammer Differential Revision: D25564477 (bbc7143) Original commit changeset: 13f36a2b84da fbshipit-source-id: 58cbe8109efaf499dd017531878b9fbbb27976bc
1 parent 5874925 commit 7767dcf

14 files changed

Lines changed: 1 addition & 132 deletions

File tree

aten/src/ATen/core/aten_interned_strings.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,6 @@ _(aten, signbit) \
622622
_(aten, silu) \
623623
_(aten, sgn) \
624624
_(aten, sin) \
625-
_(aten, sinc) \
626625
_(aten, sinh) \
627626
_(aten, size) \
628627
_(aten, sizes) \

aten/src/ATen/native/UnaryOps.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -343,10 +343,6 @@ Tensor& cos_out(Tensor& result, const Tensor& self) { return unary_op_impl_float
343343
Tensor cos(const Tensor& self) { return unary_op_impl_float(self, cos_stub); }
344344
Tensor& cos_(Tensor& self) { return unary_op_impl_(self, at::cos_out); }
345345

346-
Tensor& sinc_out(Tensor& result, const Tensor& self) { return unary_op_impl_float_out(result, self, sinc_stub); }
347-
Tensor sinc(const Tensor& self) { return unary_op_impl_float(self, sinc_stub); }
348-
Tensor& sinc_(Tensor& self) { return unary_op_impl_(self, at::sinc_out); }
349-
350346
Tensor& sinh_out(Tensor& result, const Tensor& self) { return unary_op_impl_float_out(result, self, sinh_stub); }
351347
Tensor sinh(const Tensor& self) { return unary_op_impl_float(self, sinh_stub); }
352348
Tensor& sinh_(Tensor& self) { return unary_op_impl_(self, at::sinh_out); }
@@ -721,7 +717,6 @@ DEFINE_DISPATCH(sign_stub);
721717
DEFINE_DISPATCH(signbit_stub);
722718
DEFINE_DISPATCH(sgn_stub);
723719
DEFINE_DISPATCH(sin_stub);
724-
DEFINE_DISPATCH(sinc_stub);
725720
DEFINE_DISPATCH(sinh_stub);
726721
DEFINE_DISPATCH(sqrt_stub);
727722
DEFINE_DISPATCH(tan_stub);

aten/src/ATen/native/UnaryOps.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ DECLARE_DISPATCH(unary_fn, sign_stub);
5555
DECLARE_DISPATCH(unary_fn, signbit_stub);
5656
DECLARE_DISPATCH(unary_fn, sgn_stub);
5757
DECLARE_DISPATCH(unary_fn, sin_stub);
58-
DECLARE_DISPATCH(unary_fn, sinc_stub);
5958
DECLARE_DISPATCH(unary_fn, sinh_stub);
6059
DECLARE_DISPATCH(unary_fn, sqrt_stub);
6160
DECLARE_DISPATCH(unary_fn, tan_stub);

aten/src/ATen/native/cpu/UnaryOpsKernel.cpp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -302,21 +302,6 @@ static void sgn_kernel(TensorIterator& iter){
302302
});
303303
}
304304

305-
static void sinc_kernel(TensorIterator& iter) {
306-
AT_DISPATCH_FLOATING_AND_COMPLEX_TYPES_AND1(kBFloat16, iter.common_dtype(), "sinc_cpu", [&]() {
307-
cpu_kernel(
308-
iter,
309-
[=](scalar_t a) -> scalar_t {
310-
if (a == scalar_t(0)) {
311-
return scalar_t(1);
312-
} else {
313-
scalar_t product = scalar_t(M_PI) * a;
314-
return std::sin(product) / product;
315-
}
316-
});
317-
});
318-
}
319-
320305
static void sinh_kernel(TensorIterator& iter) {
321306
AT_DISPATCH_FLOATING_AND_COMPLEX_TYPES(iter.dtype(), "sinh_cpu", [&]() {
322307
cpu_kernel_vec(
@@ -692,7 +677,6 @@ REGISTER_DISPATCH(neg_stub, &neg_kernel);
692677
REGISTER_DISPATCH(sign_stub, &sign_kernel);
693678
REGISTER_DISPATCH(signbit_stub, &signbit_kernel);
694679
REGISTER_DISPATCH(sgn_stub, &sgn_kernel);
695-
REGISTER_DISPATCH(sinc_stub, &sinc_kernel);
696680
REGISTER_DISPATCH(sinh_stub, &sinh_kernel);
697681
REGISTER_DISPATCH(cosh_stub, &cosh_kernel);
698682
REGISTER_DISPATCH(acosh_stub, &acosh_kernel);

aten/src/ATen/native/cuda/UnaryOpsKernel.cu

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -103,19 +103,6 @@ void sigmoid_kernel_cuda(TensorIterator& iter) {
103103
});
104104
}
105105

106-
void sinc_kernel_cuda(TensorIterator& iter) {
107-
AT_DISPATCH_FLOATING_AND_COMPLEX_TYPES_AND1(ScalarType::Half, iter.common_dtype(), "sinc_cuda", [&]() {
108-
gpu_kernel(iter, []GPU_LAMBDA(scalar_t a) -> scalar_t {
109-
if (a == scalar_t(0)) {
110-
return scalar_t(1);
111-
} else {
112-
scalar_t product = scalar_t(M_PI) * a;
113-
return std::sin(product) / product;
114-
}
115-
});
116-
});
117-
}
118-
119106
void logit_kernel_cuda(TensorIterator& iter, Scalar eps_scalar) {
120107
AT_DISPATCH_FLOATING_TYPES_AND2(
121108
at::ScalarType::Half,
@@ -258,7 +245,6 @@ REGISTER_DISPATCH(i0_stub, &i0_kernel_cuda);
258245
REGISTER_DISPATCH(rsqrt_stub, &rsqrt_kernel_cuda);
259246
REGISTER_DISPATCH(sqrt_stub, &sqrt_kernel_cuda);
260247
REGISTER_DISPATCH(sigmoid_stub, &sigmoid_kernel_cuda);
261-
REGISTER_DISPATCH(sinc_stub, &sinc_kernel_cuda);
262248
REGISTER_DISPATCH(logit_stub, &logit_kernel_cuda);
263249
REGISTER_DISPATCH(erf_stub, &erf_kernel_cuda);
264250
REGISTER_DISPATCH(erfc_stub, &erfc_kernel_cuda);

aten/src/ATen/native/native_functions.yaml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3720,22 +3720,6 @@
37203720
dispatch:
37213721
CPU, CUDA: sin_out
37223722

3723-
- func: sinc(Tensor self) -> Tensor
3724-
use_c10_dispatcher: full
3725-
variants: function, method
3726-
dispatch:
3727-
DefaultBackend: sinc
3728-
3729-
- func: sinc_(Tensor(a!) self) -> Tensor(a!)
3730-
use_c10_dispatcher: full
3731-
variants: function, method
3732-
dispatch:
3733-
DefaultBackend: sinc_
3734-
3735-
- func: sinc.out(Tensor self, *, Tensor(a!) out) -> Tensor(a!)
3736-
dispatch:
3737-
CPU, CUDA: sinc_out
3738-
37393723
- func: sinh(Tensor self) -> Tensor
37403724
use_c10_dispatcher: full
37413725
variants: function, method

docs/source/tensors.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -558,8 +558,6 @@ view of a storage and defines numeric operations on it.
558558
.. automethod:: sgn_
559559
.. automethod:: sin
560560
.. automethod:: sin_
561-
.. automethod:: sinc
562-
.. automethod:: sinc_
563561
.. automethod:: sinh
564562
.. automethod:: sinh_
565563
.. automethod:: asinh

docs/source/torch.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,6 @@ Pointwise Ops
340340
sign
341341
signbit
342342
sin
343-
sinc
344343
sinh
345344
sqrt
346345
square

tools/autograd/derivatives.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -961,9 +961,6 @@
961961
- name: sin(Tensor self) -> Tensor
962962
self: grad * self.cos().conj()
963963

964-
- name: sinc(Tensor self) -> Tensor
965-
self: grad * ((M_PI * self * (M_PI * self).cos() - (M_PI * self).sin()) / (M_PI * self * self)).conj()
966-
967964
- name: sinh(Tensor self) -> Tensor
968965
self: grad * self.cosh().conj()
969966

tools/autograd/gen_variable_type.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
'repeat', 'expand', 'flip', 'fliplr', 'flipud', 'rot90', 'transpose',
7171
'permute', 'squeeze', 'unsqueeze', 'resize', 'resize_as', 'tril', 'triu',
7272
'chunk', 'split', 'split_with_sizes', 'repeat', 'expand', 'zero_', 'eq_',
73-
'ne_', 'add', '__radd__', 'sum', '_conj', 'sin', 'cos', 'mul', 'sinc', 'sinh',
73+
'ne_', 'add', '__radd__', 'sum', '_conj', 'sin', 'cos', 'mul', 'sinh',
7474
'cosh', '__rmul__', 'sgn', 'asin', 'acos', 'sub', 'div', 'cat', 'view_as_complex',
7575
'neg', 'complex', 'select', '_s_where', 'as_strided', 'slice', 'constant_pad_nd',
7676
'unbind', 'split', 'split_with_sizes', 'unsafe_split', 'split_with_sizes_backward',

0 commit comments

Comments
 (0)