forked from mindspore-Ecosystem/mindspore
!19643 update docs for its wrong output
Merge pull request !19643 from dinglinhe/code_docs_dlh_ms_I3ZJRT
This commit is contained in:
commit
56cf5f70c6
|
@ -1035,7 +1035,6 @@ class Split(PrimitiveWithCheck):
|
|||
>>> split = ops.Split(1, 2)
|
||||
>>> x = Tensor(np.array([[1, 1, 1, 1], [2, 2, 2, 2]]), mindspore.int32)
|
||||
>>> print(x)
|
||||
Tensor(shape=[2, 4], dtype=Int32, value=
|
||||
[[1 1 1 1]
|
||||
[2 2 2 2]])
|
||||
>>> output = split(x)
|
||||
|
@ -3115,7 +3114,8 @@ class StridedSlice(PrimitiveWithInfer):
|
|||
>>> # ]
|
||||
>>> # The final output after finishing is:
|
||||
>>> print(output)
|
||||
[[[3], [5]]]
|
||||
[[[3.]]
|
||||
[[5.]]]
|
||||
>>> # another example like :
|
||||
>>> output = strided_slice(input_x, (1, 0, 0), (2, 1, 3), (1, 1, 1))
|
||||
>>> print(output)
|
||||
|
@ -3417,8 +3417,8 @@ class Eye(PrimitiveWithInfer):
|
|||
>>> reverse = ops.ReverseV2([1])
|
||||
>>> anti_diagonal_output = reverse(anti_diagonal_input)
|
||||
>>> print(anti_diagonal_output)
|
||||
[[1. 0.]
|
||||
[0. 1.]]
|
||||
[[0 1]
|
||||
[1 0]]
|
||||
"""
|
||||
|
||||
@prim_attr_register
|
||||
|
@ -4573,7 +4573,7 @@ class ScatterNdSub(_ScatterNdOp):
|
|||
[[ 0 0 0 0]
|
||||
[ 0 0 0 0]
|
||||
[ 0 0 0 0]
|
||||
[ 0 0 0 0]]
|
||||
[ 0 0 0 0]]]
|
||||
"""
|
||||
|
||||
|
||||
|
|
|
@ -3561,11 +3561,11 @@ class FastGeLU(PrimitiveWithInfer):
|
|||
|
||||
Examples:
|
||||
>>> tensor = Tensor(np.array([[-1.0, 4.0, -8.0], [2.0, -5.0, 9.0]]), mindspore.float32)
|
||||
>>> fast_gelu = P.FastGeLU()
|
||||
>>> fast_gelu = ops.FastGeLU()
|
||||
>>> output = fast_gelu(tensor)
|
||||
>>> print(output)
|
||||
[[-1.5420423e-01 3.9955849e+00 -9.7664278e-06]
|
||||
[ 1.9356585e+00 -1.0070159e-03 8.9999981e+00]]
|
||||
[[-1.5418735e-01 3.9921875e+00 -9.7473649e-06]
|
||||
[ 1.9375000e+00 -1.0052517e-03 8.9824219e+00]]
|
||||
"""
|
||||
|
||||
@prim_attr_register
|
||||
|
@ -7267,16 +7267,22 @@ class CTCGreedyDecoder(PrimitiveWithCheck):
|
|||
``Ascend``
|
||||
|
||||
Examples:
|
||||
>>> inputs = Tensor(np.random.random((2, 2, 3)), mindspore.float32)
|
||||
>>> inputs = Tensor(np.array([[[0.6, 0.4, 0.2], [0.8, 0.6, 0.3]]
|
||||
... [[0.0, 0.6, 0.0], [0.5, 0.4, 0.5]]]), mindspore.float32)
|
||||
>>> sequence_length = Tensor(np.array([2, 2]), mindspore.int32)
|
||||
>>> ctc_greedy_decoder = ops.CTCGreedyDecoder()
|
||||
>>> decoded_indices, decoded_values, decoded_shape, log_probability =
|
||||
... ctc_greedy_decoder(inputs, sequence_length)
|
||||
>>> print(decoded_indices, decoded_values, decoded_shape, log_probability)
|
||||
[[0 0] [1 0] [1 1]]
|
||||
>>> ctc_greedyDecoder = ops.CTCGreedyDecoder()
|
||||
>>> decoded_indices, decoded_values, decoded_shape, log_probability = ctc_greedyDecoder(inputs, sequence_length)
|
||||
>>> print(decoded_indices)
|
||||
[[0 0]
|
||||
[0 1]
|
||||
[1 0]]
|
||||
>>> print(decoded_values)
|
||||
[0 1 0]
|
||||
>>> print(decoded_shape)
|
||||
[2 2]
|
||||
[[-1.3671273] [-1.7975442]]
|
||||
>>> print(log_probability)
|
||||
[[-1.2]
|
||||
[-1.3]]
|
||||
"""
|
||||
|
||||
@prim_attr_register
|
||||
|
|
Loading…
Reference in New Issue