PyTorch torch.cosh function
PyTorch torch reference manual
torch.cosh is a PyTorch function for computing the hyperbolic cosine element-wise.
Function definition
torch.cosh(input, *, out=None)
Usage examples
Example
import
torch
Hyperbolic cosine example
x
=
torch.
tensor
(
[
0
,
1
,
2
,
3
]
,
dtype
=
torch.
float32
)
result
=
torch.
cosh
(
x
)
(
result
)