fn
cos
→Tensorcos(input: Tensor)Element-wise cosine (input in radians).
Computes the cosine of each entry treating the input as an angle in radians.
Parameters
inputTensorInput tensor.
Returns
TensorElement-wise result with the same shape as input.
Notes
Mathematical definition:
Gradient: .
Examples
>>> import lucid
>>> x = lucid.tensor([1.0, 2.0, 3.0])
>>> lucid.cos(x)
Tensor([...])