From e5d0d87a936e1d9519dd3a87b36ca086ee7195c1 Mon Sep 17 00:00:00 2001 From: hedongdong Date: Thu, 18 Feb 2021 10:49:55 +0800 Subject: [PATCH] [Docs] update formulas for math and array operators --- mindspore/ops/operations/array_ops.py | 14 ++++++++++++++ mindspore/ops/operations/math_ops.py | 1 + 2 files changed, 15 insertions(+) diff --git a/mindspore/ops/operations/array_ops.py b/mindspore/ops/operations/array_ops.py index 9102f973f79..b3943b94642 100644 --- a/mindspore/ops/operations/array_ops.py +++ b/mindspore/ops/operations/array_ops.py @@ -3275,7 +3275,9 @@ class ScatterUpdate(_ScatterOp_Dynamic): Using given values to update tensor value, along with the input indices. for each `i, ..., j` in `indices.shape`: + .. math:: + \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. @@ -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. for each `i, ..., j` in `indices.shape`: + .. math:: + \text{input_x}[\text{indices}[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. for each `i, ..., j` in `indices.shape`: + .. math:: + \text{input_x}[\text{indices}[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. for each `i, ..., j` in `indices.shape`: + .. math:: + \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. @@ -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. for each `i, ..., j` in `indices.shape`: + .. math:: + \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. @@ -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. for each `i, ..., j` in `indices.shape`: + .. math:: + \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. @@ -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. for each `i, ..., j` in `indices.shape`: + .. math:: + \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. diff --git a/mindspore/ops/operations/math_ops.py b/mindspore/ops/operations/math_ops.py index e05714ad8cb..a5419e9c4f1 100644 --- a/mindspore/ops/operations/math_ops.py +++ b/mindspore/ops/operations/math_ops.py @@ -794,6 +794,7 @@ class BatchMatMul(MatMul): Computes matrix multiplication between two tensors by batch. .. math:: + \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`.