Shortcuts

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])

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources