Browse Source

!21359 udpate docs for it's the long time import information and the docs of Concat

Merge pull request !21359 from dinglinhe/code_docs_dlh_ms_I4367G_1
tags/v1.5.0-rc1
i-robot Gitee 4 years ago
parent
commit
d060933db2
3 changed files with 11 additions and 14 deletions
  1. +9
    -10
      mindspore/ops/operations/array_ops.py
  2. +1
    -2
      mindspore/ops/operations/inner_ops.py
  3. +1
    -2
      mindspore/ops/operations/other_ops.py

+ 9
- 10
mindspore/ops/operations/array_ops.py View File

@@ -1286,7 +1286,6 @@ class Ones(PrimitiveWithInfer):
``Ascend`` ``GPU`` ``CPU``

Examples:
>>> from mindspore.ops import operations as ops
>>> ones = ops.Ones()
>>> output = ones((2, 2), mindspore.float32)
>>> print(output)
@@ -1348,7 +1347,6 @@ class Zeros(Primitive):
``Ascend`` ``GPU`` ``CPU``

Examples:
>>> from mindspore.ops import operations as ops
>>> zeros = ops.Zeros()
>>> output = zeros((2, 2), mindspore.float32)
>>> print(output)
@@ -2303,13 +2301,14 @@ class Concat(PrimitiveWithInfer):

Inputs:
- **input_x** (tuple, list) - A tuple or a list of input tensors.
`input_x`, `input_y` should has same data type.
- **input_y** (tuple, list) - A tuple or a list of input tensors.
`input_x`, `input_y` should has same data type.
Suppose there are two tensors in this tuple or list, namely x1 and x2.
To perform `Concat` in the axis 0 direction, except for the 0th axis, all other axes should be equal,
that is, :math:`x1.shape[1] == x2.shape[1], x1.shape[2] == x2.shape[2], ..., x1.shape[R] == x2.shape[R]',
where the :math:`R' indicates the last axis.

Outputs:
Tensor, the shape is :math:`(x_1, x_2, ..., \sum_{i=1}^Nx_{mi}, ..., x_R)`.
The data type is the same with `input_X` and `input_y`.
The data type is the same with `input_x`.

Raises:
TypeError: If `axis` is not an int.
@@ -2318,17 +2317,17 @@ class Concat(PrimitiveWithInfer):
``Ascend`` ``GPU`` ``CPU``

Examples:
>>> input_x = Tensor(np.array([[0, 1], [2, 1]]).astype(np.float32))
>>> input_y = Tensor(np.array([[0, 1], [2, 1]]).astype(np.float32))
>>> input_x1 = Tensor(np.array([[0, 1], [2, 1]]).astype(np.float32))
>>> input_x2 = Tensor(np.array([[0, 1], [2, 1]]).astype(np.float32))
>>> op = ops.Concat()
>>> output = op((input_x, input_y))
>>> output = op((input_x1, input_x2))
>>> print(output)
[[0. 1.]
[2. 1.]
[0. 1.]
[2. 1.]]
>>> op = ops.Concat(1)
>>> output = op((input_x, input_y))
>>> output = op((input_x1, input_x2))
>>> print(output)
[[0. 1. 0. 1.]
[2. 1. 2. 1.]]


+ 1
- 2
mindspore/ops/operations/inner_ops.py View File

@@ -502,8 +502,7 @@ class AdamWeightDecay(PrimitiveWithInfer):
Examples:
>>> import numpy as np
>>> import mindspore.nn as nn
>>> from mindspore import Tensor, Parameter
>>> from mindspore.ops import operations as ops
>>> from mindspore import Tensor, Parameter, ops
>>> class Net(nn.Cell):
... def __init__(self):
... super(Net, self).__init__()


+ 1
- 2
mindspore/ops/operations/other_ops.py View File

@@ -291,8 +291,7 @@ class CheckValid(PrimitiveWithInfer):
>>> import mindspore
>>> import mindspore.nn as nn
>>> import numpy as np
>>> from mindspore import Tensor
>>> from mindspore.ops import operations as ops
>>> from mindspore import Tensor, ops
>>> class Net(nn.Cell):
... def __init__(self):
... super(Net, self).__init__()


Loading…
Cancel
Save