Spec-Zone.ru › PyTorch 2

torch.cos

torch.cos(input, *, out=None) → Tensor

Возвращает новый тензор с косинусом элементов input.

outi=cos⁡(inputi)\text{out}_{i} = \cos(\text{input}_{i})
Параметры

input (Тензор) – входной тензор.

Ключевые аргументы

out (Тензор, необязательно) – выходной тензор.

Пример:

>>> a = torch.randn(4)
>>> a
tensor([ 1.4309,  1.2706, -0.8562,  0.9796])
>>> torch.cos(a)
tensor([ 0.1395,  0.2957,  0.6553,  0.5574])

© 2024, PyTorch Contributors
PyTorch has a BSD-style license, as found in the LICENSE file.
https://pytorch.org/docs/2.1/generated/torch.cos.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API