mindspore.mint.abs
- mindspore.mint.abs(input)[source]
Compute the absolute value of a tensor element-wise.
\[out_i = |input_i|\]- Parameters
input (Tensor) – The input tensor.
- Returns
Tensor
- Supported Platforms:
Ascend
Examples
>>> import mindspore >>> output = mindspore.mint.abs(mindspore.tensor([-1.0, 1.0, 0.0])) >>> print(output) [1. 1. 0.]