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

18 lines
470 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
参数:
- **x** (Tensor) - Neg的输入shape :math:`(N, *)` ,其中 :math:`*` 表示任意数量的附加维度。秩应小于8。其数据类型为数值型。
2022-07-25 17:18:38 +08:00
返回:
Tensorshape和类型与输入相同。
2022-07-25 17:18:38 +08:00
异常:
- **TypeError** - `x` 不是Tensor。