add calculation picture of ScatterNd and add CPU platform for LogSigmoid, DenseBnAct, FTRL, etc.

This commit is contained in:
wangshuide2020 2021-09-15 17:34:40 +08:00
parent dbf1498492
commit 9e1b390c41
13 changed files with 40 additions and 14 deletions

View File

@ -17,7 +17,6 @@ approvers:
- john_tzanakakis
- jpc_chenjianping
- kingxian
- leonwanghui
- liangchenghui
- lilongfei15
- limingqi107

1
OWNERS
View File

@ -3,7 +3,6 @@ approvers:
- guoqi1024
- baochong
- zhaizhiqiang
- leonwanghui
files:
"akg":

BIN
docs/api_img/ScatterNd.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@ -734,7 +734,7 @@ class LogSigmoid(Cell):
TypeError: If dtype of `x` is neither float16 nor float32.
Supported Platforms:
``Ascend`` ``GPU``
``Ascend`` ``GPU`` ``CPU``
Examples:
>>> net = nn.LogSigmoid()

View File

@ -187,7 +187,7 @@ class DenseBnAct(Cell):
ValueError: If `momentum` is not in range [0, 1.0].
Supported Platforms:
``Ascend`` ``GPU``
``Ascend`` ``GPU`` ``CPU``
Examples:
>>> net = nn.DenseBnAct(3, 4)

View File

@ -737,7 +737,7 @@ class Conv3dTranspose(_Conv):
Tensor, the shape is :math:`(N, C_{out}, D_{out}, H_{out}, W_{out})`.
Supported Platforms:
``Ascend``
``Ascend`` ``GPU``
Raises:
TypeError: If `in_channels`, `out_channels` or `group` is not an int.

View File

@ -699,7 +699,7 @@ class MultiClassDiceLoss(LossBase):
ValueError: If `weights` is a tensor, but its dimension is not 2.
Supported Platforms:
``Ascend`` ``GPU``
``Ascend`` ``GPU`` ``CPU``
Examples:
>>> 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].
Supported Platforms:
``Ascend`` ``GPU``
``Ascend`` ``GPU`` ``CPU``
Examples:
>>> logits_x1 = Tensor(np.array([[0.3, 0.8], [0.4, 0.3]]), mindspore.float32)

View File

@ -170,7 +170,7 @@ class FTRL(Optimizer):
ValueError: If `initial_accum`, `l1` or `l2` is less than 0.
Supported Platforms:
``Ascend`` ``GPU``
``Ascend`` ``GPU`` ``CPU``
Examples:
>>> net = Net()

View File

@ -241,7 +241,7 @@ class Lamb(Optimizer):
ValueError: If `weight_decay` is less than 0.
Supported Platforms:
``Ascend`` ``GPU``
``Ascend`` ``GPU`` ``CPU``
Examples:
>>> net = Net()

View File

@ -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})`.
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:
- **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)`.
@ -3498,6 +3503,30 @@ class ScatterNd(PrimitiveWithInfer):
Examples:
>>> 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)
>>> updates = Tensor(np.array([3.2, 1.1]), mindspore.float32)
>>> shape = (3, 3)
@ -5690,7 +5719,7 @@ class Sort(PrimitiveWithInfer):
TypeError: If dtype of `x` is neither float16 nor float32.
Supported Platforms:
``Ascend`` ``GPU``
``Ascend`` ``GPU`` ``CPU``
Examples:
>>> x = Tensor(np.array([[8, 2, 1], [5, 9, 3], [4, 6, 7]]), mindspore.float16)

View File

@ -8243,7 +8243,7 @@ class Conv3D(PrimitiveWithInfer):
ValueError: If `data_format` is not 'NCDHW'.
Supported Platforms:
``Ascend`` ``GPU``
``Ascend`` ``GPU`` ``CPU``
Examples:
>>> x = Tensor(np.ones([16, 3, 10, 32, 32]), mindspore.float16)

View File

@ -301,7 +301,7 @@ class UniformInt(PrimitiveWithInfer):
Tensor. The shape is the same as the input 'shape', and the data type is int32.
Supported Platforms:
``Ascend`` ``GPU``
``Ascend`` ``GPU`` ``CPU``
Examples:
>>> shape = (2, 4)
@ -362,7 +362,7 @@ class UniformReal(StandardNormal):
ValueError: If `shape` is not a constant value.
Supported Platforms:
``Ascend`` ``GPU``
``Ascend`` ``GPU`` ``CPU``
Examples:
>>> shape = (2, 2)

View File

@ -17,7 +17,6 @@ approvers:
- john_tzanakakis
- jpc_chenjianping
- kingxian
- leonwanghui
- liangchenghui
- lilongfei15
- limingqi107