2022-04-25 12:55:14 +08:00
mindspore
=========
Tensor
------
.. autosummary ::
:toctree: mindspore
:nosignatures:
:template: classtemplate.rst
mindspore.Tensor
mindspore.COOTensor
mindspore.CSRTensor
mindspore.RowTensor
mindspore.SparseTensor
Parameter
---------
.. autosummary ::
:toctree: mindspore
:nosignatures:
:template: classtemplate.rst
mindspore.Parameter
mindspore.ParameterTuple
DataType
--------
.. class :: mindspore.dtype
2022-06-02 16:03:36 +08:00
2022-04-25 12:55:14 +08:00
Create a data type object of MindSpore.
2022-06-02 16:03:36 +08:00
2022-04-25 12:55:14 +08:00
The actual path of `` dtype `` is `` /mindspore/common/dtype.py `` .
Run the following command to import the package:
2022-06-02 16:03:36 +08:00
2022-04-25 12:55:14 +08:00
.. code-block ::
2022-06-02 16:03:36 +08:00
2022-04-25 12:55:14 +08:00
from mindspore import dtype as mstype
2022-06-02 16:03:36 +08:00
2022-04-25 12:55:14 +08:00
* **Numeric Type**
2022-06-02 16:03:36 +08:00
2022-04-25 12:55:14 +08:00
Currently, MindSpore supports `` Int `` type, `` Uint `` type, `` Float `` type and `` Complex `` type.
The following table lists the details.
2022-06-02 16:03:36 +08:00
2022-04-25 12:55:14 +08:00
============================================== =============================
Definition Description
============================================== =============================
`` mindspore.int8 `` , `` mindspore.byte `` 8-bit integer
2022-06-02 16:03:36 +08:00
`` mindspore.int16 `` , `` mindspore.short `` 16-bit integer
2022-04-25 12:55:14 +08:00
`` mindspore.int32 `` , `` mindspore.intc `` 32-bit integer
`` mindspore.int64 `` , `` mindspore.intp `` 64-bit integer
`` mindspore.uint8 `` , `` mindspore.ubyte `` unsigned 8-bit integer
`` mindspore.uint16 `` , `` mindspore.ushort `` unsigned 16-bit integer
`` mindspore.uint32 `` , `` mindspore.uintc `` unsigned 32-bit integer
`` mindspore.uint64 `` , `` mindspore.uintp `` unsigned 64-bit integer
`` mindspore.float16 `` , `` mindspore.half `` 16-bit floating-point number
`` mindspore.float32 `` , `` mindspore.single `` 32-bit floating-point number
`` mindspore.float64 `` , `` mindspore.double `` 64-bit floating-point number
`` mindspore.complex64 `` 64-bit complex number
`` mindspore.complex128 `` 128-bit complex number
============================================== =============================
2022-06-02 16:03:36 +08:00
2022-04-25 12:55:14 +08:00
* **Other Type**
2022-06-02 16:03:36 +08:00
2022-04-25 12:55:14 +08:00
For other defined types, see the following table.
2022-06-02 16:03:36 +08:00
2022-04-25 12:55:14 +08:00
============================ =================
Type Description
============================ =================
`` tensor `` MindSpore's `` tensor `` type. Data format uses NCHW. For details, see `tensor <https://www.gitee.com/mindspore/mindspore/blob/master/mindspore/python/mindspore/common/tensor.py> `_ .
`` bool_ `` Boolean `` True `` or `` False `` .
`` int_ `` Integer scalar.
`` uint `` Unsigned integer scalar.
`` float_ `` Floating-point scalar.
`` complex `` Complex scalar.
`` number `` Number, including `` int_ `` , `` uint `` , `` float_ `` , `` complex `` 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, 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 definition of type.
`` type_none `` No matching return type, corresponding to the `` type(None) `` in Python.
`` 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.
============================ =================
2022-06-02 16:03:36 +08:00
2022-04-25 12:55:14 +08:00
* **Tree Topology**
2022-06-02 16:03:36 +08:00
2022-04-25 12:55:14 +08:00
The relationships of the above types are as follows:
2022-06-02 16:03:36 +08:00
2022-04-25 12:55:14 +08:00
.. code-block ::
2022-06-02 16:03:36 +08:00
2022-04-25 12:55:14 +08:00
└─────── number
│ ├─── bool_
│ ├─── int_
│ │ ├─── int8, byte
│ │ ├─── int16, short
│ │ ├─── int32, intc
│ │ └─── int64, intp
│ ├─── uint
│ │ ├─── uint8, ubyte
│ │ ├─── uint16, ushort
│ │ ├─── uint32, uintc
│ │ └─── uint64, uintp
│ ├─── float_
│ │ ├─── float16
│ │ ├─── float32
│ │ └─── float64
│ └─── complex
│ ├─── complex64
│ └─── complex128
├─── tensor
│ ├─── Array[Float32]
│ └─── ...
├─── list_
│ ├─── List[Int32,Float32]
│ └─── ...
├─── tuple_
│ ├─── Tuple[Int32,Float32]
│ └─── ...
├─── function
│ ├─── Func
│ ├─── Func[(Int32, Float32), Int32]
│ └─── ...
├─── type_type
├─── type_none
├─── symbolic_key
└─── env_type
.. autosummary ::
:toctree: mindspore
:nosignatures:
:template: classtemplate.rst
mindspore.dtype_to_nptype
mindspore.dtype_to_pytype
mindspore.pytype_to_dtype
mindspore.get_py_obj_dtype
Seed
----
.. autosummary ::
:toctree: mindspore
:nosignatures:
:template: classtemplate.rst
mindspore.set_seed
mindspore.get_seed
2022-10-11 11:43:24 +08:00
Automatic Differentiation
---------------------------------
.. autosummary ::
:toctree: mindspore
:nosignatures:
:template: classtemplate.rst
mindspore.grad
mindspore.value_and_grad
mindspore.jacfwd
mindspore.jacrev
mindspore.jvp
mindspore.vjp
2022-11-03 20:35:37 +08:00
Automatic Vectorization
---------------------------------
.. autosummary ::
:toctree: mindspore
:nosignatures:
:template: classtemplate.rst
mindspore.vmap
2022-05-09 15:43:12 +08:00
Context
--------
.. autosummary ::
:toctree: mindspore
:nosignatures:
:template: classtemplate.rst
2022-05-10 11:59:45 +08:00
mindspore.set_context
2022-05-09 15:43:12 +08:00
mindspore.get_context
mindspore.set_auto_parallel_context
2022-05-10 11:59:45 +08:00
mindspore.get_auto_parallel_context
mindspore.reset_auto_parallel_context
2022-05-09 15:43:12 +08:00
mindspore.ParallelMode
2022-05-10 11:59:45 +08:00
mindspore.set_ps_context
mindspore.get_ps_context
mindspore.reset_ps_context
2022-05-11 10:06:02 +08:00
mindspore.set_algo_parameters
mindspore.get_algo_parameters
mindspore.reset_algo_parameters
2022-05-09 15:43:12 +08:00
2022-10-11 16:16:41 +08:00
Parallel
---------------
.. autosummary ::
:toctree: mindspore
:nosignatures:
:template: classtemplate.rst
mindspore.shard
2022-04-25 12:55:14 +08:00
Dataset Helper
---------------
.. autosummary ::
:toctree: mindspore
:nosignatures:
:template: classtemplate.rst
mindspore.DatasetHelper
mindspore.connect_network_with_dataset
2022-10-18 17:24:41 +08:00
mindspore.data_sink
2022-04-25 12:55:14 +08:00
Serialization
-------------
.. autosummary ::
:toctree: mindspore
:nosignatures:
:template: classtemplate.rst
2022-06-02 19:13:37 +08:00
mindspore.async_ckpt_thread_status
mindspore.build_searched_strategy
mindspore.convert_model
2022-04-25 12:55:14 +08:00
mindspore.export
mindspore.load
2022-06-02 19:13:37 +08:00
mindspore.load_checkpoint
2022-04-25 12:55:14 +08:00
mindspore.load_distributed_checkpoint
2022-06-02 19:13:37 +08:00
mindspore.load_param_into_net
2022-10-13 16:00:21 +08:00
mindspore.merge_pipeline_strategys
2022-06-02 19:13:37 +08:00
mindspore.merge_sliced_parameter
2022-10-21 11:10:23 +08:00
mindspore.obfuscate_model
2022-06-02 19:13:37 +08:00
mindspore.parse_print
2022-09-20 16:15:35 +08:00
mindspore.rank_list_for_transform
2022-04-25 12:55:14 +08:00
mindspore.restore_group_info_list
2022-06-02 19:13:37 +08:00
mindspore.save_checkpoint
2022-09-20 16:15:35 +08:00
mindspore.transform_checkpoint_by_rank
mindspore.transform_checkpoints
2022-04-25 12:55:14 +08:00
JIT
---
.. autosummary ::
:toctree: mindspore
:nosignatures:
:template: classtemplate.rst
2022-07-12 23:23:14 +08:00
mindspore.JitConfig
2022-10-18 09:01:45 +08:00
mindspore.jit
mindspore.jit_class
2022-04-25 12:55:14 +08:00
mindspore.ms_class
2022-10-18 09:01:45 +08:00
mindspore.ms_function
2022-05-18 09:38:09 +08:00
mindspore.mutable
2022-04-25 12:55:14 +08:00
Log
---
.. autosummary ::
:toctree: mindspore
:nosignatures:
:template: classtemplate.rst
mindspore.get_level
mindspore.get_log_config
Installation Verification
--------------------------
.. autosummary ::
:toctree: mindspore
:nosignatures:
:template: classtemplate.rst
mindspore.run_check
2022-05-10 11:59:45 +08:00
Debugging and Tuning
2022-04-25 12:55:14 +08:00
--------------------------
.. autosummary ::
:toctree: mindspore
:nosignatures:
:template: classtemplate.rst
2022-05-09 18:54:33 +08:00
mindspore.Profiler
2022-05-10 11:59:45 +08:00
mindspore.SummaryCollector
mindspore.SummaryLandscape
mindspore.SummaryRecord
2022-04-25 12:55:14 +08:00
mindspore.set_dump
Memory Recycle
--------------------------
.. autosummary ::
:toctree: mindspore
:nosignatures:
:template: classtemplate.rst
mindspore.ms_memory_recycle
2022-05-10 11:59:45 +08:00
Thor
---------------
.. autosummary ::
:toctree: mindspore
:nosignatures:
:template: classtemplate.rst
mindspore.ConvertModelUtils
mindspore.ConvertNetUtils