!20200 fix doc
Merge pull request !20200 from lianliguang/code_docs_primitive
This commit is contained in:
commit
d0dae7bb94
|
@ -568,7 +568,7 @@ class TBERegOp(RegOp):
|
|||
|
||||
|
||||
class DataType:
|
||||
"""
|
||||
r"""
|
||||
Ascend ops various combinations of dtype and format.
|
||||
|
||||
The current list below may be incomplete.
|
||||
|
@ -577,6 +577,7 @@ class DataType:
|
|||
|
||||
current support:
|
||||
.. code-block::
|
||||
|
||||
None_None = ("", "")
|
||||
None_Default = ("", "DefaultFormat")
|
||||
BOOL_None = ("bool", "")
|
||||
|
|
|
@ -100,7 +100,7 @@ class Primitive(Primitive_):
|
|||
name (str): Attribute Name.
|
||||
value (Any): Attribute value.
|
||||
|
||||
Example:
|
||||
Examples:
|
||||
>>> import mindspore.ops as P
|
||||
>>> a = P.Add()
|
||||
>>> a = a.add_prim_attr("attr",1)
|
||||
|
@ -119,7 +119,7 @@ class Primitive(Primitive_):
|
|||
|
||||
Args:
|
||||
name (str): Attribute Name.
|
||||
Example:
|
||||
Examples:
|
||||
>>> import mindspore.ops as P
|
||||
>>> a = P.Add()
|
||||
>>> a = a.add_prim_attr("attr",1)
|
||||
|
@ -142,7 +142,7 @@ class Primitive(Primitive_):
|
|||
In other parallel modes, please set it to be 0.
|
||||
Args:
|
||||
stage (int): The stage id for the current operation.
|
||||
Example:
|
||||
Examples:
|
||||
>>> from mindspore.ops import operations as P
|
||||
>>> add = P.Add()
|
||||
>>> print(add.set_stage(0))
|
||||
|
@ -161,7 +161,7 @@ class Primitive(Primitive_):
|
|||
|
||||
Args:
|
||||
strategy (tuple): Strategy describes the distributed parallel mode of the current primitive.
|
||||
Example:
|
||||
Examples:
|
||||
>>> from mindspore.ops import operations as P
|
||||
>>> add = P.Add()
|
||||
>>> print(add.shard(((1, 1), (1, 1))))
|
||||
|
@ -189,7 +189,7 @@ class Primitive(Primitive_):
|
|||
|
||||
Args:
|
||||
instance_name (str): Instance name of primitive operator set by user.
|
||||
Example:
|
||||
Examples:
|
||||
>>> import mindspore.ops as P
|
||||
>>> a = P.Add()
|
||||
>>> a.set_prim_instance_name("add")
|
||||
|
@ -269,7 +269,7 @@ class Primitive(Primitive_):
|
|||
Args:
|
||||
inputs (list[str]): list of inputs names.
|
||||
outputs (list[str]): list of outputs names.
|
||||
Example:
|
||||
Examples:
|
||||
>>> import mindspore.ops as P
|
||||
>>> a = P.Add()
|
||||
>>> a.init_prim_io_names(["x","y"],["sum"])
|
||||
|
@ -301,7 +301,7 @@ class Primitive(Primitive_):
|
|||
|
||||
Args:
|
||||
mode (bool): Specifies whether the primitive is recomputed. Default: True.
|
||||
Example:
|
||||
Examples:
|
||||
>>> import mindspore.ops as P
|
||||
>>> a = P.Add()
|
||||
>>> a = a.recompute()
|
||||
|
|
Loading…
Reference in New Issue