operators_doc_fix

This commit is contained in:
panfengfeng 2023-03-02 13:14:48 -05:00 committed by panfengfeng
parent 3179893eeb
commit 052c9d3fb7
11 changed files with 69 additions and 4 deletions

View File

@ -319,6 +319,7 @@ Reduction函数
mindspore.ops.argmin mindspore.ops.argmin
mindspore.ops.cummax mindspore.ops.cummax
mindspore.ops.cummin mindspore.ops.cummin
mindspore.ops.cumprod
mindspore.ops.cumsum mindspore.ops.cumsum
mindspore.ops.fmax mindspore.ops.fmax
mindspore.ops.fmin mindspore.ops.fmin
@ -583,7 +584,6 @@ Array操作
mindspore.ops.vstack mindspore.ops.vstack
mindspore.ops.where mindspore.ops.where
mindspore.ops.cross mindspore.ops.cross
mindspore.ops.cumprod
mindspore.ops.renorm mindspore.ops.renorm
类型转换 类型转换

View File

@ -0,0 +1,6 @@
mindspore.Tensor.lstsq
======================
.. py:method:: mindspore.Tensor.lstsq(A)
详情请参考 :func:`mindspore.ops.lstsq`

View File

@ -0,0 +1,6 @@
mindspore.Tensor.matmul
=======================
.. py:method:: mindspore.Tensor.matmul(tensor2)
详情请参考 :func:`mindspore.ops.matmul`

View File

@ -0,0 +1,6 @@
mindspore.Tensor.mvlgamma
=========================
.. py:method:: mindspore.Tensor.mvlgamma(p)
详情请参考 :func:`mindspore.ops.mvlgamma`

View File

@ -0,0 +1,6 @@
mindspore.Tensor.neg
====================
.. py:method:: mindspore.Tensor.neg()
详情请参考 :func:`mindspore.ops.neg`

View File

@ -184,6 +184,7 @@ mindspore.Tensor
mindspore.Tensor.logit mindspore.Tensor.logit
mindspore.Tensor.logsumexp mindspore.Tensor.logsumexp
mindspore.Tensor.long mindspore.Tensor.long
mindspore.Tensor.lstsq
mindspore.Tensor.lt mindspore.Tensor.lt
mindspore.Tensor.masked_fill mindspore.Tensor.masked_fill
mindspore.Tensor.masked_select mindspore.Tensor.masked_select

View File

@ -0,0 +1,37 @@
mindspore.ops.lstsq
===================
.. py:function:: mindspore.ops.lstsq(input, A)
计算满秩矩阵 `x` :math:`(m \times n)` 与满秩矩阵 `a` :math:`(m \times k)` 的最小二乘问题或最小范数问题的解。
:math:`m \geq n` `Lstsq` 解决最小二乘问题:
.. math::
\begin{array}{ll}
\min_y & \|xy-a\|_2.
\end{array}
:math:`m < n` `Lstsq` 解决最小范数问题:
.. math::
\begin{array}{llll}
\min_y & \|y\|_2 & \text{subject to} & xy = a.
\end{array}
其中 `y` 表示返回的Tensor。
参数:
- **input** (Tensor) - 上述公式中 :math:`(m \times n)` 的矩阵 :math:`x` 输入Tensor的数据类型为float16、float32或float64。
- **A** (Tensor) - 上述公式中 :math:`(m \times k)` 的矩阵 :math:`a` 输入Tensor的数据类型为float16、float32或float64。
返回:
Tensor最小二乘问题或最小范数问题的解其shape为 :math:`(n \times k)` ,数据类型与 `input` 相同。
异常:
- **TypeError** - `input``A` 不是Tensor。
- **TypeError** - `input``A` 不是以下数据类型之一float16、float32、float64。
- **TypeError** - `input``A` 的数据类型不同。
- **ValueError** - `input` 的维度不等于2。
- **ValueError** - `A` 的维度不等于2或1。
- **ValueError** - `input``A` shape的第零维不相等。

View File

@ -190,6 +190,7 @@
mindspore.Tensor.logit mindspore.Tensor.logit
mindspore.Tensor.logsumexp mindspore.Tensor.logsumexp
mindspore.Tensor.long mindspore.Tensor.long
mindspore.Tensor.lstsq
mindspore.Tensor.lt mindspore.Tensor.lt
mindspore.Tensor.masked_fill mindspore.Tensor.masked_fill
mindspore.Tensor.masked_select mindspore.Tensor.masked_select

View File

@ -319,6 +319,7 @@ Reduction Functions
mindspore.ops.argmin mindspore.ops.argmin
mindspore.ops.cummax mindspore.ops.cummax
mindspore.ops.cummin mindspore.ops.cummin
mindspore.ops.cumprod
mindspore.ops.cumsum mindspore.ops.cumsum
mindspore.ops.fmax mindspore.ops.fmax
mindspore.ops.fmin mindspore.ops.fmin
@ -583,7 +584,6 @@ Array Operation
mindspore.ops.vstack mindspore.ops.vstack
mindspore.ops.where mindspore.ops.where
mindspore.ops.cross mindspore.ops.cross
mindspore.ops.cumprod
mindspore.ops.renorm mindspore.ops.renorm
Type Cast Type Cast
@ -762,4 +762,4 @@ Other Functions
:template: classtemplate.rst :template: classtemplate.rst
mindspore.ops.depend mindspore.ops.depend
mindspore.ops.partial mindspore.ops.partial

View File

@ -6093,6 +6093,8 @@ def lstsq(input, A):
\min_y & \|y\|_2 & \text{subject to} & xy = a. \min_y & \|y\|_2 & \text{subject to} & xy = a.
\end{array} \end{array}
where `y` is the returned tensor.
Args: Args:
input (Tensor): The m by n matrix equivalent to `x` in above. input (Tensor): The m by n matrix equivalent to `x` in above.
The input tensor whose data type is float16, float32 or float64. The input tensor whose data type is float16, float32 or float64.

View File

@ -4241,7 +4241,7 @@ def ctc_greedy_decoder(inputs, sequence_length, merge_repeated=True):
ValueError: If value in the `sequence_length` is larger than `max_time`. ValueError: If value in the `sequence_length` is larger than `max_time`.
Supported Platforms: Supported Platforms:
``Ascend`` ``CPU`` ``Ascend`` ``GPU`` ``CPU``
Examples: Examples:
>>> inputs = Tensor(np.array([[[0.6, 0.4, 0.2], [0.8, 0.6, 0.3]], >>> inputs = Tensor(np.array([[[0.6, 0.4, 0.2], [0.8, 0.6, 0.3]],