From 5e05311072b1da7a5a733351299725f30ebf7d9b Mon Sep 17 00:00:00 2001 From: baiyangfan Date: Tue, 8 Sep 2020 09:29:11 +0800 Subject: [PATCH 1/2] create data --- api/source_en/api/python/mindspore/mindspore.dtype.rst | 2 ++ api/source_zh_cn/api/python/mindspore/mindspore.dtype.rst | 2 ++ 2 files changed, 4 insertions(+) diff --git a/api/source_en/api/python/mindspore/mindspore.dtype.rst b/api/source_en/api/python/mindspore/mindspore.dtype.rst index ab38ead244..1b7877da00 100644 --- a/api/source_en/api/python/mindspore/mindspore.dtype.rst +++ b/api/source_en/api/python/mindspore/mindspore.dtype.rst @@ -6,6 +6,8 @@ Data Type .. class:: mindspore.dtype +Create a data type object + The actual path of ``dtype`` is ``/mindspore/common/dtype.py``. Run the following command to import the package: diff --git a/api/source_zh_cn/api/python/mindspore/mindspore.dtype.rst b/api/source_zh_cn/api/python/mindspore/mindspore.dtype.rst index 8474d596a6..b89e2dbae6 100644 --- a/api/source_zh_cn/api/python/mindspore/mindspore.dtype.rst +++ b/api/source_zh_cn/api/python/mindspore/mindspore.dtype.rst @@ -6,6 +6,8 @@ Data Type .. class:: mindspore.dtype +Create a data type object + The actual path of ``dtype`` is ``/mindspore/common/dtype.py``. Run the following command to import the package: -- Gitee From 692d14efcc705133e58e85e7233fd5f87fbc9006 Mon Sep 17 00:00:00 2001 From: baiyangfan Date: Tue, 8 Sep 2020 09:52:35 +0800 Subject: [PATCH 2/2] mode_dtype --- .../api/python/mindspore/mindspore.dtype.rst | 12 ++++++------ .../api/python/mindspore/mindspore.dtype.rst | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/api/source_en/api/python/mindspore/mindspore.dtype.rst b/api/source_en/api/python/mindspore/mindspore.dtype.rst index 1b7877da00..b49a693312 100644 --- a/api/source_en/api/python/mindspore/mindspore.dtype.rst +++ b/api/source_en/api/python/mindspore/mindspore.dtype.rst @@ -51,19 +51,19 @@ For other defined types, see the following table. ============================ ================= Type Description ============================ ================= -``tensor`` MindSpore's ``tensor`` type. Data format uses NCHW. -``MetaTensor`` A tensor only has data type and shape. -``bool_`` Bool number. +``tensor`` MindSpore's ``tensor`` type. Data format uses NCHW. For details, see [tensor](https://gitee.com/mindspore/mindspore/blob/master/mindspore/common/tensor.py). +``MetaTensor`` A tensor only has data type and shape. For details, see [MetaTensor](https://gitee.com/mindspore/mindspore/blob/master/mindspore/common/parameter.py). +``bool_`` Boolean ``True`` or ``False``. ``int_`` Integer scalar. ``uint`` Unsigned integer scalar. ``float_`` Floating-point scalar. ``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. ``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)`` . -``type_type`` Type of type. +``function`` Function, when ``function`` is not None, returns a callable function that will execute the compiled function; When ``function`` is None, returns a decorator and when this decorator invokes with a single ``function`` argument, the callable function is equal to the case when ``function`` is not None. +``type_type`` Type definition of ``type``. ``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. ============================ ================= diff --git a/api/source_zh_cn/api/python/mindspore/mindspore.dtype.rst b/api/source_zh_cn/api/python/mindspore/mindspore.dtype.rst index b89e2dbae6..7c16a3ed84 100644 --- a/api/source_zh_cn/api/python/mindspore/mindspore.dtype.rst +++ b/api/source_zh_cn/api/python/mindspore/mindspore.dtype.rst @@ -51,19 +51,19 @@ For other defined types, see the following table. ============================ ================= Type Description ============================ ================= -``tensor`` MindSpore's ``tensor`` type. Data format uses NCHW. -``MetaTensor`` A tensor only has data type and shape. -``bool_`` Bool number. +``tensor`` MindSpore's ``tensor`` type. Data format uses NCHW. For details, see [tensor](https://gitee.com/mindspore/mindspore/blob/master/mindspore/common/tensor.py). +``MetaTensor`` A tensor only has data type and shape. For details, see [MetaTensor](https://gitee.com/mindspore/mindspore/blob/master/mindspore/common/parameter.py). +``bool_`` Boolean ``True`` or ``False``. ``int_`` Integer scalar. ``uint`` Unsigned integer scalar. ``float_`` Floating-point scalar. ``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. ``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)`` . -``type_type`` Type of type. +``function`` Function, when ``function`` is not None, returns a callable function that will execute the compiled function; When ``function`` is None, returns a decorator and when this decorator invokes with a single ``function`` argument, the callable function is equal to the case when ``function`` is not None. +``type_type`` Type definition of ``type``. ``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. ============================ ================= -- Gitee