fn

sin

Tensor
sin(input: Tensor)
source

Element-wise sine (input in radians).

Computes the sine of each entry treating the input as an angle in radians.

Parameters

inputTensor
Input tensor.

Returns

Tensor

Element-wise result with the same shape as input.

Notes

Mathematical definition:

outi=sin(inputi)\text{out}_i = \sin(\text{input}_i)

Gradient: cos(x)\cos(x).

Examples

>>> import lucid
>>> x = lucid.tensor([1.0, 2.0, 3.0])
>>> lucid.sin(x)
Tensor([...])