mindspore.ops.eps

View Source On Gitee
mindspore.ops.eps(x)[source]

Create a Tensor with the same data type and shape as input, and the element value is the minimum value that the corresponding data type can express.

Parameters

x (Tensor) – Tensor of any dimension used to obtain the minimum value that its data type can express. The data type must be float16, float32 or float64.

Returns

Tensor, has the same type and shape as x, but filled with x dtype minimum val.

Raises
  • TypeError – If x is not a Tensor.

  • TypeError – If data type of x is neither float16, float32, nor float64.

Supported Platforms:

Ascend GPU CPU

Examples

>>> import mindspore
>>> from mindspore import Tensor, ops
>>> x = Tensor([4, 1, 2, 3], mindspore.float32)
>>> output = ops.eps(x)
>>> print(output)
[1.1920929e-07 1.1920929e-07 1.1920929e-07 1.1920929e-07]