torch_cos function

Cos

Cos

torch_cos(self)

Arguments

  • self: (Tensor) the input tensor.

cos(input, out=NULL) -> Tensor

Returns a new tensor with the cosine of the elements of input.

\mboxouti=cos(\mboxinputi) \mbox{out}_{i} = \cos(\mbox{input}_{i})

Examples

if (torch_is_installed()) { a = torch_randn(c(4)) a torch_cos(a) }
  • Maintainer: Daniel Falbel
  • License: MIT + file LICENSE
  • Last published: 2025-02-14