mindspore
Tensor
Tensor is used for data storage. |
|
A sparse representation of a set of tensor slices at given indices. |
|
A sparse representation of a set of nonzero elememts from a tensor at given indices. |
Parameter
An object holding weights of cells, after initialized Parameter is a subtype of Tensor. |
|
Class for storing tuple of parameters. |
DataType
- class mindspore.dtype
Create a data type object of MindSpore.
The actual path of
dtypeis/mindspore/common/dtype.py. Run the following command to import the package:from mindspore import dtype as mstype
Numeric Type
Currently, MindSpore supports
Inttype,Uinttype andFloattype. The following table lists the details.Definition
Description
mindspore.int8,mindspore.byte8-bit integer
mindspore.int16,mindspore.short16-bit integer
mindspore.int32,mindspore.intc32-bit integer
mindspore.int64,mindspore.intp64-bit integer
mindspore.uint8,mindspore.ubyteunsigned 8-bit integer
mindspore.uint16,mindspore.ushortunsigned 16-bit integer
mindspore.uint32,mindspore.uintcunsigned 32-bit integer
mindspore.uint64,mindspore.uintpunsigned 64-bit integer
mindspore.float16,mindspore.half16-bit floating-point number
mindspore.float32,mindspore.single32-bit floating-point number
mindspore.float64,mindspore.double64-bit floating-point number
mindspore.complex6464-bit complex number
mindspore.complex128128-bit complex number
Other Type
For other defined types, see the following table.
Type
Description
tensorMindSpore’s
tensortype. Data format uses NCHW. For details, see tensor.bool_Boolean
TrueorFalse.int_Integer scalar.
uintUnsigned integer scalar.
float_Floating-point scalar.
complexComplex scalar.
numberNumber, including
int_,uint,float_,complexandbool_.list_List constructed by
tensor, such asList[T0,T1,...,Tn], where the elementTican be of different types.tuple_Tuple constructed by
tensor, such asTuple[T0,T1,...,Tn], where the elementTican be of different types.functionFunction. 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_typeType definition of type.
type_noneNo matching return type, corresponding to the
type(None)in Python.symbolic_keyThe value of a variable is used as a key of the variable in
env_type.env_typeUsed to store the gradient of the free variable of a function, where the key is the
symbolic_keyof the free variable’s node and the value is the gradient.Tree Topology
The relationships of the above types are as follows:
└─────── 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
Convert MindSpore dtype to numpy data type. |
|
Determine whether type_ is a subclass of dtype. |
|
Convert MindSpore dtype to python data type. |
|
Convert python type to MindSpore type. |
|
Get the MindSpore data type, which corresponds to python type or variable. |
Seed
Set global seed. |
|
Get global seed. |
Model
High-Level API for training or inference. |
Dataset Helper
DatasetHelper is a class to process the MindData dataset and provides the information of dataset. |
|
Connect the network with dataset in dataset_helper. |
Loss Scale Manager
Loss scale manager abstract class. |
|
Loss scale with a fixed value, inherits from LossScaleManager. |
|
Loss scale that dynamically adjusts itself, inherits from LossScaleManager. |
Serialization
Save checkpoint to a specified file. |
|
Load checkpoint info from a specified file. |
|
Load parameters into network. |
|
Export the mindspore network into an offline model in the specified format. |
|
Load MindIR. |
|
Parse saved data generated by mindspore.ops.Print. |
|
Build strategy of every parameter in network. |
|
Merge parameter slices into one parameter. |
|
Load checkpoint into net for distributed predication. |
|
Get the status of asynchronous save checkpoint thread. |
JIT
Create a callable MindSpore graph from a Python function. |
Log
Get the logger level. |
|
Get logger configurations. |
Automatic Mixed Precision
Build the mixed precision training cell automatically. |
Installation Verification
Provide a convenient API to check if the installation is successful or failed. |