mindspore/docs/api/api_python/ops/mindspore.ops.func_subtract...

23 lines
707 B
ReStructuredText
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

mindspore.ops.subtract
=======================
.. py:function:: mindspore.ops.subtract(x, other, *, alpha=1)
对Tensor进行逐元素的减法。
.. math::
output[i] = x[i] - alpha * other[i]
参数:
- **x** (Union[Tensor, number.Number]) - 参与减法的Tensor或者Number。
- **other** (Union[Tensor, number.Number]) - 参与减法的Tensor或者Number。
关键字参数:
- **alpha** (Number) - :math:`other` 的乘数。默认值1。
返回:
Tensorshape与广播后的shape相同数据类型为输入中精度较高的类型。
异常:
- **TypeError** - `x``other` 不是Tensor、number.Number。