mindspore.ops.cosh

mindspore.ops.cosh(x)[source]

Computes hyperbolic cosine of input element-wise.

\[out_i = \cosh(x_i)\]
Parameters

x (Tensor) – The input tensor of hyperbolic cosine function, its rank must be in [0, 7] inclusive and data type must be float16, float32, float64, complex64 or complex128.

Returns

Tensor, has the same shape as x.

Raises
  • TypeError – If the dtype of x is not one of the following types: float16, float32, float64, complex64, complex128.

  • TypeError – If x is not a Tensor.

Supported Platforms:

Ascend GPU CPU

Examples

>>> x = Tensor(np.array([0.24, 0.83, 0.31, 0.09]), mindspore.float32)
>>> output = ops.cosh(x)
>>> print(output)
[1.0289385 1.364684 1.048436 1.0040528]