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

26 lines
1019 B
ReStructuredText
Raw Permalink 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.addr
==================
.. py:function:: mindspore.ops.addr(x, vec1, vec2, *, beta=1, alpha=1)
计算 `vec1``vec2` 的外积,并加到 `x` 中。
.. note::
- 如果 `vec1` 是一个大小为 :math:`N` 的向量, `vec2` 是一个大小为 :math:`M` 的向量,则 `x` 的大小可广播为 。
`x` 必须能够与大小为 :math:`(N, M)` 的矩阵进行广播,且输出将是大小为 :math:`(N, M)` 的矩阵。
-`beta` 为0那么 `input` 将会被忽略。
.. math::
output = β x + α (vec1 ⊗ vec2)
参数:
- **x** (Tensor) - 输入tensor。
- **vec1** (Tensor) - 将被乘的向量。
- **vec2** (Tensor) - 将被乘的向量。
关键字参数:
- **beta** (scalar[int, float, bool], 可选) - `x` 的尺度因子。默认 ``1``
- **alpha** (scalar[int, float, bool], 可选) - `vec1``vec2` )的尺度因子。默认 ``1``
返回:
Tensor