提交 607012bb 编写于 作者: B baiyangfan

add_dtype

上级 39f4bb91
...@@ -6,6 +6,8 @@ Data Type ...@@ -6,6 +6,8 @@ Data Type
.. class:: mindspore.dtype .. class:: mindspore.dtype
Create a data type object of MindSpore.
The actual path of ``dtype`` is ``/mindspore/common/dtype.py``. The actual path of ``dtype`` is ``/mindspore/common/dtype.py``.
Run the following command to import the package: Run the following command to import the package:
...@@ -49,19 +51,19 @@ For other defined types, see the following table. ...@@ -49,19 +51,19 @@ For other defined types, see the following table.
============================ ================= ============================ =================
Type Description Type Description
============================ ================= ============================ =================
``tensor`` MindSpore's ``tensor`` type. Data format uses NCHW. ``tensor`` MindSpore's ``tensor`` type. Data format uses NCHW. For details, see [tensor](https://www.gitee.com/mindspore/mindspore/blob/master/mindspore/common/tensor.py).
``MetaTensor`` A tensor only has data type and shape. ``MetaTensor`` A tensor only has data type and shape. For details, see [MetaTensor](https://www.gitee.com/mindspore/mindspore/blob/master/mindspore/common/parameter.py).
``bool_`` Bool number. ``bool_`` Boolean ``True`` or ``False``.
``int_`` Integer scalar. ``int_`` Integer scalar.
``uint`` Unsigned integer scalar. ``uint`` Unsigned integer scalar.
``float_`` Floating-point scalar. ``float_`` Floating-point scalar.
``number`` Number, including ``int_`` , ``uint`` , ``float_`` and ``bool_`` . ``number`` Number, including ``int_`` , ``uint`` , ``float_`` and ``bool_`` .
``list_`` List constructed by ``tensor`` , such as ``List[T0,T1,...,Tn]`` , where the element ``Ti`` can be of different types. ``list_`` List constructed by ``tensor`` , such as ``List[T0,T1,...,Tn]`` , where the element ``Ti`` can be of different types.
``tuple_`` Tuple constructed by ``tensor`` , such as ``Tuple[T0,T1,...,Tn]`` , where the element ``Ti`` can be of different types. ``tuple_`` Tuple constructed by ``tensor`` , such as ``Tuple[T0,T1,...,Tn]`` , where the element ``Ti`` can be of different types.
``function`` Function. Return in two ways, one returns ``Func`` directly, the other returns ``Func(args: List[T0,T1,...,Tn], retval: T)`` . ``function`` Function. Return in two ways, when function is not None, returns Func directly, the other returns Func(args: List[T0,T1,...,Tn], retval: T) when function is None.
``type_type`` Type of type. ``type_type`` Type definition of type.
``type_none`` No matching return type, corresponding to the ``type(None)`` in Python. ``type_none`` No matching return type, corresponding to the ``type(None)`` in Python.
``symbolic_key`` The value of a variable managed by embd, which is used as a key of the variable in ``env_type`` . ``symbolic_key`` The value of a variable is used as a key of the variable in ``env_type`` .
``env_type`` Used to store the gradient of the free variable of a function, where the key is the ``symbolic_key`` of the free variable's node and the value is the gradient. ``env_type`` Used to store the gradient of the free variable of a function, where the key is the ``symbolic_key`` of the free variable's node and the value is the gradient.
============================ ================= ============================ =================
......
...@@ -6,6 +6,8 @@ Data Type ...@@ -6,6 +6,8 @@ Data Type
.. class:: mindspore.dtype .. class:: mindspore.dtype
Create a data type object of MindSpore.
The actual path of ``dtype`` is ``/mindspore/common/dtype.py``. The actual path of ``dtype`` is ``/mindspore/common/dtype.py``.
Run the following command to import the package: Run the following command to import the package:
...@@ -49,19 +51,19 @@ For other defined types, see the following table. ...@@ -49,19 +51,19 @@ For other defined types, see the following table.
============================ ================= ============================ =================
Type Description Type Description
============================ ================= ============================ =================
``tensor`` MindSpore's ``tensor`` type. Data format uses NCHW. ``tensor`` MindSpore's ``tensor`` type. Data format uses NCHW. For details, see [tensor](https://www.gitee.com/mindspore/mindspore/blob/master/mindspore/common/tensor.py).
``MetaTensor`` A tensor only has data type and shape. ``MetaTensor`` A tensor only has data type and shape. For details, see [MetaTensor](https://www.gitee.com/mindspore/mindspore/blob/master/mindspore/common/parameter.py).
``bool_`` Bool number. ``bool_`` Boolean ``True`` or ``False``.
``int_`` Integer scalar. ``int_`` Integer scalar.
``uint`` Unsigned integer scalar. ``uint`` Unsigned integer scalar.
``float_`` Floating-point scalar. ``float_`` Floating-point scalar.
``number`` Number, including ``int_`` , ``uint`` , ``float_`` and ``bool_`` . ``number`` Number, including ``int_`` , ``uint`` , ``float_`` and ``bool_`` .
``list_`` List constructed by ``tensor`` , such as ``List[T0,T1,...,Tn]`` , where the element ``Ti`` can be of different types. ``list_`` List constructed by ``tensor`` , such as ``List[T0,T1,...,Tn]`` , where the element ``Ti`` can be of different types.
``tuple_`` Tuple constructed by ``tensor`` , such as ``Tuple[T0,T1,...,Tn]`` , where the element ``Ti`` can be of different types. ``tuple_`` Tuple constructed by ``tensor`` , such as ``Tuple[T0,T1,...,Tn]`` , where the element ``Ti`` can be of different types.
``function`` Function. Return in two ways, one returns ``Func`` directly, the other returns ``Func(args: List[T0,T1,...,Tn], retval: T)`` . ``function`` Function. Return in two ways, when function is not None, returns Func directly, the other returns Func(args: List[T0,T1,...,Tn], retval: T) when function is None.
``type_type`` Type of type. ``type_type`` Type definition of type.
``type_none`` No matching return type, corresponding to the ``type(None)`` in Python. ``type_none`` No matching return type, corresponding to the ``type(None)`` in Python.
``symbolic_key`` The value of a variable managed by embd, which is used as a key of the variable in ``env_type`` . ``symbolic_key`` The value of a variable is used as a key of the variable in ``env_type`` .
``env_type`` Used to store the gradient of the free variable of a function, where the key is the ``symbolic_key`` of the free variable's node and the value is the gradient. ``env_type`` Used to store the gradient of the free variable of a function, where the key is the ``symbolic_key`` of the free variable's node and the value is the gradient.
============================ ================= ============================ =================
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册