Browse Source

[Docs] update formulas for math and array operators

tags/v1.2.0-rc1
hedongdong 4 years ago
parent
commit
e5d0d87a93
2 changed files with 15 additions and 0 deletions
  1. +14
    -0
      mindspore/ops/operations/array_ops.py
  2. +1
    -0
      mindspore/ops/operations/math_ops.py

+ 14
- 0
mindspore/ops/operations/array_ops.py View File

@@ -3275,7 +3275,9 @@ class ScatterUpdate(_ScatterOp_Dynamic):
Using given values to update tensor value, along with the input indices. Using given values to update tensor value, along with the input indices.


for each `i, ..., j` in `indices.shape`: for each `i, ..., j` in `indices.shape`:

.. math:: .. math::

\text{input_x}[\text{indices}[i, ..., j], :] = \text{updates}[i, ..., j, :] \text{input_x}[\text{indices}[i, ..., j], :] = \text{updates}[i, ..., j, :]


Inputs of `input_x` and `updates` comply with the implicit type conversion rules to make the data types consistent. Inputs of `input_x` and `updates` comply with the implicit type conversion rules to make the data types consistent.
@@ -3391,7 +3393,9 @@ class ScatterMax(_ScatterOp):
This operation outputs the `input_x` after the update is done, which makes it convenient to use the updated value. This operation outputs the `input_x` after the update is done, which makes it convenient to use the updated value.


for each `i, ..., j` in `indices.shape`: for each `i, ..., j` in `indices.shape`:

.. math:: .. math::

\text{input_x}[\text{indices}[i, ..., j], :] \text{input_x}[\text{indices}[i, ..., j], :]
= max(\text{input_x}[\text{indices}[i, ..., j], :], \text{updates}[i, ..., j, :]) = max(\text{input_x}[\text{indices}[i, ..., j], :], \text{updates}[i, ..., j, :])


@@ -3435,7 +3439,9 @@ class ScatterMin(_ScatterOp):
This operation outputs the `input_x` after the update is done, which makes it convenient to use the updated value. This operation outputs the `input_x` after the update is done, which makes it convenient to use the updated value.


for each `i, ..., j` in `indices.shape`: for each `i, ..., j` in `indices.shape`:

.. math:: .. math::

\text{input_x}[\text{indices}[i, ..., j], :] \text{input_x}[\text{indices}[i, ..., j], :]
= min(\text{input_x}[\text{indices}[i, ..., j], :], \text{updates}[i, ..., j, :]) = min(\text{input_x}[\text{indices}[i, ..., j], :], \text{updates}[i, ..., j, :])


@@ -3479,7 +3485,9 @@ class ScatterAdd(_ScatterOp_Dynamic):
This operation outputs the `input_x` after the update is done, which makes it convenient to use the updated value. This operation outputs the `input_x` after the update is done, which makes it convenient to use the updated value.


for each `i, ..., j` in `indices.shape`: for each `i, ..., j` in `indices.shape`:

.. math:: .. math::

\text{input_x}[\text{indices}[i, ..., j], :] \mathrel{+}= \text{updates}[i, ..., j, :] \text{input_x}[\text{indices}[i, ..., j], :] \mathrel{+}= \text{updates}[i, ..., j, :]


Inputs of `input_x` and `updates` comply with the implicit type conversion rules to make the data types consistent. Inputs of `input_x` and `updates` comply with the implicit type conversion rules to make the data types consistent.
@@ -3529,7 +3537,9 @@ class ScatterSub(_ScatterOp):
This operation outputs the `input_x` after the update is done, which makes it convenient to use the updated value. This operation outputs the `input_x` after the update is done, which makes it convenient to use the updated value.


for each `i, ..., j` in `indices.shape`: for each `i, ..., j` in `indices.shape`:

.. math:: .. math::

\text{input_x}[\text{indices}[i, ..., j], :] \mathrel{-}= \text{updates}[i, ..., j, :] \text{input_x}[\text{indices}[i, ..., j], :] \mathrel{-}= \text{updates}[i, ..., j, :]


Inputs of `input_x` and `updates` comply with the implicit type conversion rules to make the data types consistent. Inputs of `input_x` and `updates` comply with the implicit type conversion rules to make the data types consistent.
@@ -3573,7 +3583,9 @@ class ScatterMul(_ScatterOp):
This operation outputs the `input_x` after the update is done, which makes it convenient to use the updated value. This operation outputs the `input_x` after the update is done, which makes it convenient to use the updated value.


for each `i, ..., j` in `indices.shape`: for each `i, ..., j` in `indices.shape`:

.. math:: .. math::

\text{input_x}[\text{indices}[i, ..., j], :] \mathrel{*}= \text{updates}[i, ..., j, :] \text{input_x}[\text{indices}[i, ..., j], :] \mathrel{*}= \text{updates}[i, ..., j, :]


Inputs of `input_x` and `updates` comply with the implicit type conversion rules to make the data types consistent. Inputs of `input_x` and `updates` comply with the implicit type conversion rules to make the data types consistent.
@@ -3616,7 +3628,9 @@ class ScatterDiv(_ScatterOp):
This operation outputs the `input_x` after the update is done, which makes it convenient to use the updated value. This operation outputs the `input_x` after the update is done, which makes it convenient to use the updated value.


for each `i, ..., j` in `indices.shape`: for each `i, ..., j` in `indices.shape`:

.. math:: .. math::

\text{input_x}[\text{indices}[i, ..., j], :] \mathrel{/}= \text{updates}[i, ..., j, :] \text{input_x}[\text{indices}[i, ..., j], :] \mathrel{/}= \text{updates}[i, ..., j, :]


Inputs of `input_x` and `updates` comply with the implicit type conversion rules to make the data types consistent. Inputs of `input_x` and `updates` comply with the implicit type conversion rules to make the data types consistent.


+ 1
- 0
mindspore/ops/operations/math_ops.py View File

@@ -794,6 +794,7 @@ class BatchMatMul(MatMul):
Computes matrix multiplication between two tensors by batch. Computes matrix multiplication between two tensors by batch.


.. math:: .. math::

\text{output}[..., :, :] = \text{matrix}(a[..., :, :]) * \text{matrix}(b[..., :, :]) \text{output}[..., :, :] = \text{matrix}(a[..., :, :]) * \text{matrix}(b[..., :, :])


The two input tensors must have the same rank and the rank must be not less than `3`. The two input tensors must have the same rank and the rank must be not less than `3`.


Loading…
Cancel
Save