diff --git a/docs/api/api_python/mindspore.rst b/docs/api/api_python/mindspore.rst index 9b189542412..fd465278db1 100644 --- a/docs/api/api_python/mindspore.rst +++ b/docs/api/api_python/mindspore.rst @@ -36,6 +36,7 @@ mindspore mindspore.dtype_to_pytype mindspore.pytype_to_dtype mindspore.get_py_obj_dtype + mindspore.QuantDtype 运行环境 --------- diff --git a/docs/api/api_python/mindspore/mindspore.QuantDtype.rst b/docs/api/api_python/mindspore/mindspore.QuantDtype.rst new file mode 100644 index 00000000000..98c96950e41 --- /dev/null +++ b/docs/api/api_python/mindspore/mindspore.QuantDtype.rst @@ -0,0 +1,19 @@ +mindspore.QuantDtype +==================== + +.. py:class:: mindspore.QuantDtype + + MindSpore量化数据类型枚举类,包含 `INT1` ~ `INT16`,`UINT1` ~ `UINT16` 。 + + `QuantDtype` 定义在 `/mindspore/common/dtype.py` 文件下 。运行以下命令导入环境: + + .. code-block:: + + from mindspore import QuantDtype + + .. py:method:: value(self) + + 获取当前 `QuantDtype` 的值。 + + 返回: + int,表示当前 `QuantDtype` 的值。 diff --git a/docs/api/api_python_en/mindspore.rst b/docs/api/api_python_en/mindspore.rst index 6d29567b538..442298c86bf 100644 --- a/docs/api/api_python_en/mindspore.rst +++ b/docs/api/api_python_en/mindspore.rst @@ -143,6 +143,7 @@ DataType mindspore.dtype_to_pytype mindspore.pytype_to_dtype mindspore.get_py_obj_dtype + mindspore.QuantDtype Context -------- diff --git a/mindspore/python/mindspore/common/__init__.py b/mindspore/python/mindspore/common/__init__.py index c0790151c4d..c2e51a10be6 100644 --- a/mindspore/python/mindspore/common/__init__.py +++ b/mindspore/python/mindspore/common/__init__.py @@ -21,7 +21,7 @@ from mindspore.common.dtype import Type, int8, byte, int16, short, int32, intc, float32, single, float64, double, bool_, float_, list_, tuple_, int_, \ uint, number, tensor, string, type_none, tensor_type, Int, \ complex64, complex128, dtype_to_nptype, _null, _null_type, \ - dtype_to_pytype, pytype_to_dtype, get_py_obj_dtype + dtype_to_pytype, pytype_to_dtype, get_py_obj_dtype, QuantDtype from mindspore.common.dump import set_dump from mindspore.common.parameter import Parameter, ParameterTuple from mindspore.common.seed import set_seed, get_seed @@ -50,7 +50,7 @@ __all__ = [ "number", "tensor", "string", "type_none", "_null", - "tensor_type", + "tensor_type", "QuantDtype", "Type", "Int", "_null_type", "complex64", "complex128", # __method__ from dtype