torch.sinc

torch.sinc(input, *, out=None) → Tensor

Computes the normalized sinc of input.

outi={1,if inputi=0sin(πinputi)/(πinputi),otherwise\text{out}_{i} = \begin{cases} 1, & \text{if}\ \text{input}_{i}=0 \\ \sin(\pi \text{input}_{i}) / (\pi \text{input}_{i}), & \text{otherwise} \end{cases}
Parameters

input (Tensor) – the input tensor.

Keyword Arguments

out (Tensor, optional) – the output tensor.

Example:

>>> a = torch.randn(4)
>>> a
tensor([ 0.2252, -0.2948,  1.0267, -1.1566])
>>> torch.sinc(a)
tensor([ 0.9186,  0.8631, -0.0259, -0.1300])

© 2019 Torch Contributors
Licensed under the 3-clause BSD License.
https://pytorch.org/docs/1.8.0/generated/torch.sinc.html