cos

nvtripy.cos(input: Tensor) Tensor[source]

Computes the elementwise cosine of the elements of the input tensor.

Parameters:

input (Tensor) – [dtype=T1] The input tensor.

Returns:

[dtype=T1] A new tensor of the same shape as the input tensor.

Return type:

Tensor

DATA TYPE CONSTRAINTS:
Example
1input = tp.arange(3, dtype=tp.float32)
2output = tp.cos(input)
Local Variables
>>> input
tensor([0, 1, 2], dtype=float32, loc=gpu:0, shape=(3,))

>>> output
tensor([1, 0.540302, -0.416147], dtype=float32, loc=gpu:0, shape=(3,))