Browse Source

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

tags/v1.5.0-rc1
wangshuide2020 4 years ago
parent
commit
9e1b390c41
13 changed files with 40 additions and 14 deletions
  1. +0
    -1
      .jenkins/OWNERS
  2. +0
    -1
      OWNERS
  3. BIN
      docs/api_img/ScatterNd.png
  4. +1
    -1
      mindspore/nn/layer/activation.py
  5. +1
    -1
      mindspore/nn/layer/combined.py
  6. +1
    -1
      mindspore/nn/layer/conv.py
  7. +2
    -2
      mindspore/nn/loss/loss.py
  8. +1
    -1
      mindspore/nn/optim/ftrl.py
  9. +1
    -1
      mindspore/nn/optim/lamb.py
  10. +30
    -1
      mindspore/ops/operations/array_ops.py
  11. +1
    -1
      mindspore/ops/operations/nn_ops.py
  12. +2
    -2
      mindspore/ops/operations/random_ops.py
  13. +0
    -1
      tests/OWNERS

+ 0
- 1
.jenkins/OWNERS View File

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


+ 0
- 1
OWNERS View File

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

files:
"akg":


BIN
docs/api_img/ScatterNd.png View File

Before After
Width: 528  |  Height: 238  |  Size: 16 kB

+ 1
- 1
mindspore/nn/layer/activation.py 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()


+ 1
- 1
mindspore/nn/layer/combined.py 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)


+ 1
- 1
mindspore/nn/layer/conv.py 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.


+ 2
- 2
mindspore/nn/loss/loss.py 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)


+ 1
- 1
mindspore/nn/optim/ftrl.py 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()


+ 1
- 1
mindspore/nn/optim/lamb.py 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()


+ 30
- 1
mindspore/ops/operations/array_ops.py 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)


+ 1
- 1
mindspore/ops/operations/nn_ops.py 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)


+ 2
- 2
mindspore/ops/operations/random_ops.py 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)


+ 0
- 1
tests/OWNERS View File

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


Loading…
Cancel
Save