fix issue I1DBRX

delete duplicated words in comments

fix issue I1CJAP

fix issue I1D3WS

fix issue I1DBA8

fix issue I1CJ77

fix issue I1CJG3

fix review suggestion
pull/104/head
万万没想到 5 years ago
parent 0830ad932b
commit c3d210cc31

@ -249,7 +249,7 @@ class LayerNorm(Cell):
'he_uniform', etc. Default: 'zeros'. 'he_uniform', etc. Default: 'zeros'.
Inputs: 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`. and `input_shape[begin_norm_axis:]` is equal to `normalized_shape`.
Outputs: Outputs:

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

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

File diff suppressed because it is too large Load Diff

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

Loading…
Cancel
Save