!28446 correct code examples etc.

Merge pull request !28446 from chentangyu/code_docs_cty_master_I4NUSK_I4NWQW_I4OTOQ
This commit is contained in:
i-robot 2022-01-05 01:56:21 +00:00 committed by Gitee
commit 3febbbf1eb
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
6 changed files with 22 additions and 22 deletions

View File

@ -36,5 +36,5 @@ mindspore.nn.HSwish
>>> hswish = nn.HSwish()
>>> result = hswish(x)
>>> print(result)
[-0.3333 -0.3333 0 1.666 0.6665]
[-0.3333 -0.3333 0. 1.667 0.6665]

View File

@ -735,7 +735,7 @@ class HSwish(Cell):
>>> hswish = nn.HSwish()
>>> result = hswish(x)
>>> print(result)
[-0.3333 -0.3333 0 1.666 0.6665]
[-0.3333 -0.3333 0. 1.667 0.6665]
"""
def __init__(self):

View File

@ -114,9 +114,9 @@ class SparseTensorDenseMatmul(Cell):
>>> sparse_dense_matmul = nn.SparseTensorDenseMatmul()
>>> out = sparse_dense_matmul(indices, values, sparse_shape, dense)
>>> print(out)
[[2 2]
[6 6]
[0 0]]
[[2. 2.]
[6. 6.]
[0. 0.]]
"""
def __init__(self, adjoint_st=False, adjoint_dt=False):

View File

@ -676,7 +676,7 @@ class CustomRegOp(RegOp):
Class used for generating the registration information for the `func` parameter of :class:`mindspore.ops.Custom`.
Args:
op_name (str): kernel name. No need to set this value as `Custom` operator will generate a unique name
op_name (str): kernel name. No need to set this value as `Custom`, operator will generate a unique name
automatically. Default: "Custom".
Examples:

View File

@ -748,8 +748,8 @@ class ReduceSum(_Reduce):
class ReduceAll(_Reduce):
"""
Reduces a dimension of a tensor by the "logicalAND" of all elements in the dimension, by Default. And also can
reduces a dimension of `x` along the axis. Determine whether the dimensions of the output and input are the same by
Reduces a dimension of a tensor by the "logicalAND" of all elements in the dimension, by default. And also can
reduce a dimension of `x` along the axis. Determine whether the dimensions of the output and input are the same by
controlling `keep_dims`.
Args:
@ -807,8 +807,8 @@ class ReduceAll(_Reduce):
class ReduceAny(_Reduce):
"""
Reduces a dimension of a tensor by the "logical OR" of all elements in the dimension, by Default. And also can
reduces a dimension of `x` along the axis. Determine whether the dimensions of the output and input are the same by
Reduces a dimension of a tensor by the "logical OR" of all elements in the dimension, by default. And also can
reduce a dimension of `x` along the axis. Determine whether the dimensions of the output and input are the same by
controlling `keep_dims`.
Args:
@ -866,8 +866,8 @@ class ReduceAny(_Reduce):
class ReduceMax(_Reduce):
"""
Reduces a dimension of a tensor by the maximum value in this dimension, by Default. And also can
reduces a dimension of `x` along the axis. Determine whether the dimensions of the output and input are the same by
Reduces a dimension of a tensor by the maximum value in this dimension, by default. And also can
reduce a dimension of `x` along the axis. Determine whether the dimensions of the output and input are the same by
controlling `keep_dims`.
Args:
@ -953,8 +953,8 @@ class ReduceMax(_Reduce):
class ReduceMin(_Reduce):
"""
Reduces a dimension of a tensor by the minimum value in the dimension, by Default. And also can
reduces a dimension of `x` along the axis. Determine whether the dimensions of the output and input are the same by
Reduces a dimension of a tensor by the minimum value in the dimension, by default. And also can
reduce a dimension of `x` along the axis. Determine whether the dimensions of the output and input are the same by
controlling `keep_dims`.
Args:
@ -1031,8 +1031,8 @@ class ReduceMin(_Reduce):
class ReduceProd(_Reduce):
"""
Reduces a dimension of a tensor by multiplying all elements in the dimension, by Default. And also can
reduces a dimension of `x` along the axis. Determine whether the dimensions of the output and input are the same by
Reduces a dimension of a tensor by multiplying all elements in the dimension, by default. And also can
reduce a dimension of `x` along the axis. Determine whether the dimensions of the output and input are the same by
controlling `keep_dims`.
Args:

View File

@ -52,9 +52,9 @@ class SparseToDense(PrimitiveWithInfer):
>>> sparse_to_dense = ops.SparseToDense()
>>> out = sparse_to_dense(indices, values, sparse_shape)
>>> print(out)
[[0 1 0 0]
[0 0 2 0]
[0 0 0 0]]
[[0. 1. 0. 0.]
[0. 0. 2. 0.]
[0. 0. 0. 0.]]
"""
@prim_attr_register
@ -133,9 +133,9 @@ class SparseTensorDenseMatmul(PrimitiveWithInfer):
>>> sparse_dense_matmul = ops.SparseTensorDenseMatmul()
>>> out = sparse_dense_matmul(indices, values, sparse_shape, dense)
>>> print(out)
[[2 2]
[6 6]
[0 0]]
[[2. 2.]
[6. 6.]
[0. 0.]]
"""
@prim_attr_register