2022-08-27 10:39:21 +08:00
|
|
|
|
mindspore.ops.abs
|
|
|
|
|
|
==================
|
|
|
|
|
|
|
2023-03-02 11:16:11 +08:00
|
|
|
|
.. py:function:: mindspore.ops.abs(input)
|
2022-08-27 10:39:21 +08:00
|
|
|
|
|
|
|
|
|
|
逐元素计算输入Tensor的绝对值。
|
|
|
|
|
|
|
|
|
|
|
|
.. math::
|
2023-03-02 11:16:11 +08:00
|
|
|
|
out_i = |input_i|
|
2022-08-27 10:39:21 +08:00
|
|
|
|
|
|
|
|
|
|
参数:
|
2023-03-02 11:16:11 +08:00
|
|
|
|
- **input** (Tensor) - 输入Tensor。T其shape为 :math:`(N,*)` ,其中 :math:`*` 表示任意数量的附加维度。
|
2022-08-27 10:39:21 +08:00
|
|
|
|
|
|
|
|
|
|
返回:
|
2023-03-02 11:16:11 +08:00
|
|
|
|
Tensor,shape与 `input` 相同。
|
2022-08-27 10:39:21 +08:00
|
|
|
|
|
|
|
|
|
|
异常:
|
2023-03-02 11:16:11 +08:00
|
|
|
|
- **TypeError** - 如果 `input` 不是Tensor。
|