!104 fix doc issues

Merge pull request !104 from 万万没想到/fix-doc-issues
pull/104/MERGE
mindspore-ci-bot 5 years ago committed by Gitee
commit 10481470df

@ -249,7 +249,7 @@ class LayerNorm(Cell):
'he_uniform', etc. Default: 'zeros'.
Inputs:
- **input_x** (Tensor) - The shape of 'input_x' is input_shape = :math:`(x_1, x_2, ..., x_R)`,
- **input_x** (Tensor) - The shape of 'input_x' is :math:`(x_1, x_2, ..., x_R)`,
and `input_shape[begin_norm_axis:]` is equal to `normalized_shape`.
Outputs:

@ -443,7 +443,6 @@ class Transpose(PrimitiveWithInfer):
Examples:
>>> input_tensor = Tensor(np.array([[[1, 2, 3], [4, 5, 6]], [[7, 8, 9], [10, 11, 12]]]), mindspore.float32)
>>> perm = (0, 2, 1)
>>> expect = np.array([[[1, 4], [2, 5], [3, 6]], [[7, 10], [8, 11], [9, 12]]])
>>> transpose = Transpose()
>>> output = transpose(input_tensor, perm)
"""
@ -1634,7 +1633,7 @@ class Diag(PrimitiveWithInfer):
Examples:
>>> input_x = Tensor([1, 2, 3, 4])
>>> diag = P.Diag()
>>> diag(x)
>>> diag(input_x)
[[1, 0, 0, 0],
[0, 2, 0, 0],
[0, 0, 3, 0],

@ -107,8 +107,8 @@ class GeSwitch(PrimitiveWithInfer):
>>> ret = self.merge((add_ret, sq_ret))
>>> return ret[0]
>>>
>>> x = Tensor(x_init, dtype=mindspore.float32)
>>> y = Tensor(y_init, dtype=mindspore.float32)
>>> x = Tensor(10.0, dtype=mindspore.float32)
>>> y = Tensor(5.0, dtype=mindspore.float32)
>>> net = Net()
>>> output = net(x, y)
"""

File diff suppressed because it is too large Load Diff

@ -1089,9 +1089,10 @@ class TopK(PrimitiveWithInfer):
- **indices** (Tensor) - The indices of values within the last dimension of input.
Examples:
>>> topk = TopK(sorted=True)
>>> x = Tensor(np.array([1, 2, 3, 4, 5]).astype(np.float16))
>>> values, indices = topk(x)
>>> topk = P.TopK(sorted=True)
>>> input_x = Tensor([1, 2, 3, 4, 5], mindspore.float16))
>>> k = 3
>>> values, indices = topk(input_x, k)
>>> assert values == Tensor(np.array([5, 4, 3]))
>>> assert indices == Tensor(np.array([4, 3, 2]))
"""

Loading…
Cancel
Save