forked from mindspore-Ecosystem/mindspore
!23550 add calculation picture of ScatterNd and add CPU platform for LogSigmoid, DenseBnAct, FTRL, etc.
Merge pull request !23550 from wangshuide/code_docs_wsd_master
This commit is contained in:
commit
5919315f5e
|
@ -17,7 +17,6 @@ approvers:
|
||||||
- john_tzanakakis
|
- john_tzanakakis
|
||||||
- jpc_chenjianping
|
- jpc_chenjianping
|
||||||
- kingxian
|
- kingxian
|
||||||
- leonwanghui
|
|
||||||
- liangchenghui
|
- liangchenghui
|
||||||
- lilongfei15
|
- lilongfei15
|
||||||
- limingqi107
|
- limingqi107
|
||||||
|
|
1
OWNERS
1
OWNERS
|
@ -3,7 +3,6 @@ approvers:
|
||||||
- guoqi1024
|
- guoqi1024
|
||||||
- baochong
|
- baochong
|
||||||
- zhaizhiqiang
|
- zhaizhiqiang
|
||||||
- leonwanghui
|
|
||||||
|
|
||||||
files:
|
files:
|
||||||
"akg":
|
"akg":
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 16 KiB |
|
@ -734,7 +734,7 @@ class LogSigmoid(Cell):
|
||||||
TypeError: If dtype of `x` is neither float16 nor float32.
|
TypeError: If dtype of `x` is neither float16 nor float32.
|
||||||
|
|
||||||
Supported Platforms:
|
Supported Platforms:
|
||||||
``Ascend`` ``GPU``
|
``Ascend`` ``GPU`` ``CPU``
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
>>> net = nn.LogSigmoid()
|
>>> net = nn.LogSigmoid()
|
||||||
|
|
|
@ -187,7 +187,7 @@ class DenseBnAct(Cell):
|
||||||
ValueError: If `momentum` is not in range [0, 1.0].
|
ValueError: If `momentum` is not in range [0, 1.0].
|
||||||
|
|
||||||
Supported Platforms:
|
Supported Platforms:
|
||||||
``Ascend`` ``GPU``
|
``Ascend`` ``GPU`` ``CPU``
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
>>> net = nn.DenseBnAct(3, 4)
|
>>> net = nn.DenseBnAct(3, 4)
|
||||||
|
|
|
@ -737,7 +737,7 @@ class Conv3dTranspose(_Conv):
|
||||||
Tensor, the shape is :math:`(N, C_{out}, D_{out}, H_{out}, W_{out})`.
|
Tensor, the shape is :math:`(N, C_{out}, D_{out}, H_{out}, W_{out})`.
|
||||||
|
|
||||||
Supported Platforms:
|
Supported Platforms:
|
||||||
``Ascend``
|
``Ascend`` ``GPU``
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
TypeError: If `in_channels`, `out_channels` or `group` is not an int.
|
TypeError: If `in_channels`, `out_channels` or `group` is not an int.
|
||||||
|
|
|
@ -699,7 +699,7 @@ class MultiClassDiceLoss(LossBase):
|
||||||
ValueError: If `weights` is a tensor, but its dimension is not 2.
|
ValueError: If `weights` is a tensor, but its dimension is not 2.
|
||||||
|
|
||||||
Supported Platforms:
|
Supported Platforms:
|
||||||
``Ascend`` ``GPU``
|
``Ascend`` ``GPU`` ``CPU``
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
>>> loss = nn.MultiClassDiceLoss(weights=None, ignore_indiex=None, activation="softmax")
|
>>> loss = nn.MultiClassDiceLoss(weights=None, ignore_indiex=None, activation="softmax")
|
||||||
|
@ -1095,7 +1095,7 @@ class CosineEmbeddingLoss(LossBase):
|
||||||
ValueError: If `margin` is not in range [-1, 1].
|
ValueError: If `margin` is not in range [-1, 1].
|
||||||
|
|
||||||
Supported Platforms:
|
Supported Platforms:
|
||||||
``Ascend`` ``GPU``
|
``Ascend`` ``GPU`` ``CPU``
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
>>> logits_x1 = Tensor(np.array([[0.3, 0.8], [0.4, 0.3]]), mindspore.float32)
|
>>> logits_x1 = Tensor(np.array([[0.3, 0.8], [0.4, 0.3]]), mindspore.float32)
|
||||||
|
|
|
@ -170,7 +170,7 @@ class FTRL(Optimizer):
|
||||||
ValueError: If `initial_accum`, `l1` or `l2` is less than 0.
|
ValueError: If `initial_accum`, `l1` or `l2` is less than 0.
|
||||||
|
|
||||||
Supported Platforms:
|
Supported Platforms:
|
||||||
``Ascend`` ``GPU``
|
``Ascend`` ``GPU`` ``CPU``
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
>>> net = Net()
|
>>> net = Net()
|
||||||
|
|
|
@ -241,7 +241,7 @@ class Lamb(Optimizer):
|
||||||
ValueError: If `weight_decay` is less than 0.
|
ValueError: If `weight_decay` is less than 0.
|
||||||
|
|
||||||
Supported Platforms:
|
Supported Platforms:
|
||||||
``Ascend`` ``GPU``
|
``Ascend`` ``GPU`` ``CPU``
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
>>> net = Net()
|
>>> net = Net()
|
||||||
|
|
|
@ -3475,6 +3475,11 @@ class ScatterNd(PrimitiveWithInfer):
|
||||||
|
|
||||||
`updates` is a tensor of rank `Q-1+P-N`. Its shape is: :math:`(i_0, i_1, ..., i_{Q-2}, shape_N, ..., shape_{P-1})`.
|
`updates` is a tensor of rank `Q-1+P-N`. Its shape is: :math:`(i_0, i_1, ..., i_{Q-2}, shape_N, ..., shape_{P-1})`.
|
||||||
|
|
||||||
|
The following figure shows the calculation process of inserting two slices in the first dimension of a rank-3
|
||||||
|
with two matrices of new values:
|
||||||
|
|
||||||
|
.. image:: api_img/ScatterNd.png
|
||||||
|
|
||||||
Inputs:
|
Inputs:
|
||||||
- **indices** (Tensor) - The index of scattering in the new tensor with int32 or int64 data type.
|
- **indices** (Tensor) - The index of scattering in the new tensor with int32 or int64 data type.
|
||||||
The rank of indices must be at least 2 and `indices_shape[-1] <= len(shape)`.
|
The rank of indices must be at least 2 and `indices_shape[-1] <= len(shape)`.
|
||||||
|
@ -3498,6 +3503,30 @@ class ScatterNd(PrimitiveWithInfer):
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
>>> op = ops.ScatterNd()
|
>>> op = ops.ScatterNd()
|
||||||
|
>>> indices = Tensor(np.array([[0], [2]]), mindspore.int32)
|
||||||
|
>>> updates = Tensor(np.array([[[1, 1, 1, 1], [2, 2, 2, 2],
|
||||||
|
... [3, 3, 3, 3], [4, 4, 4, 4]],
|
||||||
|
... [[1, 1, 1, 1], [2, 2, 2, 2],
|
||||||
|
... [3, 3, 3, 3], [4, 4, 4, 4]]]), mindspore.float32)
|
||||||
|
>>> shape = (4, 4, 4)
|
||||||
|
>>> output = op(indices, updates, shape)
|
||||||
|
>>> print(output)
|
||||||
|
[[[1. 1. 1. 1.]
|
||||||
|
[2. 2. 2. 2.]
|
||||||
|
[3. 3. 3. 3.]
|
||||||
|
[4. 4. 4. 4.]]
|
||||||
|
[[0. 0. 0. 0.]
|
||||||
|
[0. 0. 0. 0.]
|
||||||
|
[0. 0. 0. 0.]
|
||||||
|
[0. 0. 0. 0.]]
|
||||||
|
[[1. 1. 1. 1.]
|
||||||
|
[2. 2. 2. 2.]
|
||||||
|
[3. 3. 3. 3.]
|
||||||
|
[4. 4. 4. 4.]]
|
||||||
|
[[0. 0. 0. 0.]
|
||||||
|
[0. 0. 0. 0.]
|
||||||
|
[0. 0. 0. 0.]
|
||||||
|
[0. 0. 0. 0.]]]
|
||||||
>>> indices = Tensor(np.array([[0, 1], [1, 1]]), mindspore.int32)
|
>>> indices = Tensor(np.array([[0, 1], [1, 1]]), mindspore.int32)
|
||||||
>>> updates = Tensor(np.array([3.2, 1.1]), mindspore.float32)
|
>>> updates = Tensor(np.array([3.2, 1.1]), mindspore.float32)
|
||||||
>>> shape = (3, 3)
|
>>> shape = (3, 3)
|
||||||
|
@ -5690,7 +5719,7 @@ class Sort(PrimitiveWithInfer):
|
||||||
TypeError: If dtype of `x` is neither float16 nor float32.
|
TypeError: If dtype of `x` is neither float16 nor float32.
|
||||||
|
|
||||||
Supported Platforms:
|
Supported Platforms:
|
||||||
``Ascend`` ``GPU``
|
``Ascend`` ``GPU`` ``CPU``
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
>>> x = Tensor(np.array([[8, 2, 1], [5, 9, 3], [4, 6, 7]]), mindspore.float16)
|
>>> x = Tensor(np.array([[8, 2, 1], [5, 9, 3], [4, 6, 7]]), mindspore.float16)
|
||||||
|
|
|
@ -8243,7 +8243,7 @@ class Conv3D(PrimitiveWithInfer):
|
||||||
ValueError: If `data_format` is not 'NCDHW'.
|
ValueError: If `data_format` is not 'NCDHW'.
|
||||||
|
|
||||||
Supported Platforms:
|
Supported Platforms:
|
||||||
``Ascend`` ``GPU``
|
``Ascend`` ``GPU`` ``CPU``
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
>>> x = Tensor(np.ones([16, 3, 10, 32, 32]), mindspore.float16)
|
>>> x = Tensor(np.ones([16, 3, 10, 32, 32]), mindspore.float16)
|
||||||
|
|
|
@ -301,7 +301,7 @@ class UniformInt(PrimitiveWithInfer):
|
||||||
Tensor. The shape is the same as the input 'shape', and the data type is int32.
|
Tensor. The shape is the same as the input 'shape', and the data type is int32.
|
||||||
|
|
||||||
Supported Platforms:
|
Supported Platforms:
|
||||||
``Ascend`` ``GPU``
|
``Ascend`` ``GPU`` ``CPU``
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
>>> shape = (2, 4)
|
>>> shape = (2, 4)
|
||||||
|
@ -362,7 +362,7 @@ class UniformReal(StandardNormal):
|
||||||
ValueError: If `shape` is not a constant value.
|
ValueError: If `shape` is not a constant value.
|
||||||
|
|
||||||
Supported Platforms:
|
Supported Platforms:
|
||||||
``Ascend`` ``GPU``
|
``Ascend`` ``GPU`` ``CPU``
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
>>> shape = (2, 2)
|
>>> shape = (2, 2)
|
||||||
|
|
|
@ -17,7 +17,6 @@ approvers:
|
||||||
- john_tzanakakis
|
- john_tzanakakis
|
||||||
- jpc_chenjianping
|
- jpc_chenjianping
|
||||||
- kingxian
|
- kingxian
|
||||||
- leonwanghui
|
|
||||||
- liangchenghui
|
- liangchenghui
|
||||||
- lilongfei15
|
- lilongfei15
|
||||||
- limingqi107
|
- limingqi107
|
||||||
|
|
Loading…
Reference in New Issue