mindspore/docs/api/api_python/ops/mindspore.ops.func_neg.rst

19 lines
414 B
ReStructuredText
Raw Normal View History

mindspore.ops.neg
===================
.. py:function:: mindspore.ops.neg(x)
计算输入x的相反数并返回。
.. math::
out_{i} = - x_{i}
2022-07-25 17:18:38 +08:00
参数:
2022-12-09 11:45:51 +08:00
- **x** (Tensor) - Neg的输入Tensor其秩应在[0, 7]范围内,数据类型为数值型。
2022-07-25 17:18:38 +08:00
返回:
2022-12-09 11:45:51 +08:00
Tensorshape和数据类型与输入相同。
2022-07-25 17:18:38 +08:00
异常:
2022-12-09 11:45:51 +08:00
- **TypeError** - `x` 不是Tensor。