mindspore.Tensor.cosh
- Tensor.cosh() Tensor
Computes hyperbolic cosine of self element-wise.
\[out_i = \cosh(self_i)\]- Returns
Tensor, has the same shape as self.
- Raises
- Supported Platforms:
Ascend
GPU
CPU
Examples
>>> import mindspore >>> import numpy as np >>> from mindspore import Tensor >>> x = Tensor(np.array([0.24, 0.83, 0.31, 0.09]), mindspore.float32) >>> output = x.cosh() >>> print(output) [1.0289385 1.364684 1.048436 1.0040528] >>> x = Tensor(2.1, mindspore.float32) >>> output = x.cosh() >>> print(output) 4.144313