提交 3c4ebe5b 编写于 作者: M mindspore-ci-bot 提交者: Gitee

!943 add index of docs

Merge pull request !943 from TingWang/add-lite-api
# mindspore::lite
## Allocator
Allocator defines a memory pool for dynamic memory malloc and memory free.
## Context
Context is defined for holding environment variables during runtime.
**Constructors & Destructors**
```
Context()
```
Constructor of MindSpore Lite Context using default value for parameters.
```
Context(int thread_num, std::shared_ptr< Allocator > allocator, DeviceContext device_ctx)
```
Constructor of MindSpore Lite Context using input value for parameters.
- Parameters
- `thread_num`: Define the work thread number during the runtime.
- `allocator`: Define the allocator for malloc.
- `device_ctx`: Define device information during the runtime.
- Returns
The instance of MindSpore Lite Context.
```
~Context()
```
Destructor of MindSpore Lite Context.
**Public Attributes**
```
float16_priority
```
A **bool** value. Defaults to **false**. Prior enable float16 inference.
```
device_ctx_{DT_CPU}
```
A **DeviceContext** struct.
```
thread_num_
```
An **int** value. Defaults to **2**. Thread number config for thread pool.
```
allocator
```
A **std::shared_ptr<Allocator>** pointer.
```
cpu_bind_mode_
```
A **CpuBindMode** enum variable. Defaults to **MID_CPU**.
## CpuBindMode
An **enum** type. CpuBindMode defined for holding bind cpu strategy argument.
**Attributes**
```
MID_CPU = -1
```
Bind middle cpu first.
```
HIGHER_CPU = 1
```
Bind higher cpu first.
```
NO_BIND = 0
```
No bind.
## DeviceType
An **enum** type. DeviceType defined for holding user's preferred backend.
**Attributes**
```
DT_CPU = -1
```
CPU device type.
```
DT_GPU = 1
```
GPU device type.
```
DT_NPU = 0
```
NPU device type, not supported yet.
## DeviceContext
A **struct** . DeviceContext defined for holding DeviceType.
**Attributes**
```
type
```
A **DeviceType** variable. The device type.
\ No newline at end of file
# mindspore::lite
**Functions**
```
std::string Version()
```
Global method to get a version string.
- Returns
The version string of MindSpore Lite.
C++ API
=======
.. toctree::
:maxdepth: 1
class_list
lite
session
tensor
errorcode_and_metatype
\ No newline at end of file
Here is a list of all namespace members with links to the namespace documentation for each member: # Class List
Here is a list of all classes with links to the namespace documentation for each member:
| Namespace | Class Name | Description | | Namespace | Class Name | Description |
| --- | --- | --- | | --- | --- | --- |
| mindspore::lite | [Allocator](https://www.mindspore.cn/lite/docs/en/master/api/context.html#allocator) | Allocator defines a memory pool for dynamic memory malloc and memory free. | | mindspore::lite | [Allocator](https://www.mindspore.cn/lite/docs/en/master/apicc/lite.html#allocator) | Allocator defines a memory pool for dynamic memory malloc and memory free. |
| mindspore::lite | [Context](https://www.mindspore.cn/lite/docs/en/master/api/context.html#context) | Context defines for holding environment variables during runtime. | | mindspore::lite | [Context](https://www.mindspore.cn/lite/docs/en/master/apicc/lite.html#context) | Context defines for holding environment variables during runtime. |
| mindspore::lite | [ModelImpl](https://www.mindspore.cn/lite/docs/en/master/api/model.html#modelimpl) | ModelImpl defines the implement class of Model in MindSpore Lite. | | mindspore::lite | [ModelImpl](https://www.mindspore.cn/lite/docs/en/master/apicc/lite.html#modelimpl) | ModelImpl defines the implement class of Model in MindSpore Lite. |
| mindspore::lite | [PrimitiveC](https://www.mindspore.cn/lite/docs/en/master/api/model.html#primitivec) | Primitive defines as prototype of operator. | | mindspore::lite | [PrimitiveC](https://www.mindspore.cn/lite/docs/en/master/apicc/lite.html#primitivec) | Primitive defines as prototype of operator. |
| mindspore::lite | [Model](https://www.mindspore.cn/lite/docs/en/master/api/model.html#model) | Model defines model in MindSpore Lite for managing graph. | | mindspore::lite | [Model](https://www.mindspore.cn/lite/docs/en/master/apicc/lite.html#model) | Model defines model in MindSpore Lite for managing graph. |
| mindspore::lite | [ModelBuilder](https://www.mindspore.cn/lite/docs/en/master/api/model.html#modelbuilder) | ModelBuilder is defined by MindSpore Lite. | | mindspore::lite | [ModelBuilder](https://www.mindspore.cn/lite/docs/en/master/apicc/lite.html#modelbuilder) | ModelBuilder is defined by MindSpore Lite. |
| mindspore::session | [LiteSession](https://www.mindspore.cn/lite/docs/en/master/api/lite_session.html#litesession) | LiteSession defines session in MindSpore Lite for compiling Model and forwarding model. | | mindspore::session | [LiteSession](https://www.mindspore.cn/lite/docs/en/master/apicc/session.html#litesession) | LiteSession defines session in MindSpore Lite for compiling Model and forwarding model. |
| mindspore::tensor | [MSTensor](https://www.mindspore.cn/lite/docs/en/master/api/ms_tensor.html#mstensor) | MSTensor defines tensor in MindSpore Lite. | | mindspore::tensor | [MSTensor](https://www.mindspore.cn/lite/docs/en/master/apicc/tensor.html#mstensor) | MSTensor defines tensor in MindSpore Lite. |
\ No newline at end of file \ No newline at end of file
# ErrorCode and MetaType
Description of error code and meta type supported in MindSpore Lite. Description of error code and meta type supported in MindSpore Lite.
# ErrorCode ## ErrorCode
| Definition | Value | Description | | Definition | Value | Description |
| --- | --- | --- | | --- | --- | --- |
...@@ -23,7 +25,7 @@ Description of error code and meta type supported in MindSpore Lite. ...@@ -23,7 +25,7 @@ Description of error code and meta type supported in MindSpore Lite.
| RET_INFER_ERR | -501 | Failed to infer shape. | | RET_INFER_ERR | -501 | Failed to infer shape. |
| RET_INFER_INVALID | -502 | Invalid infer shape before runtime. | | RET_INFER_INVALID | -502 | Invalid infer shape before runtime. |
# MetaType ## MetaType
An **enum** type. An **enum** type.
| Type Name | Definition | Value | Description | | Type Name | Definition | Value | Description |
......
# mindspore::lite # mindspore::lite context
## Allocator
Allocator defines a memory pool for dynamic memory malloc and memory free.
## Context
Context is defined for holding environment variables during runtime.
**Constructors & Destructors**
```
Context()
```
Constructor of MindSpore Lite Context using default value for parameters.
```
Context(int thread_num, std::shared_ptr< Allocator > allocator, DeviceContext device_ctx)
```
Constructor of MindSpore Lite Context using input value for parameters.
- Parameters
- `thread_num`: Define the work thread number during the runtime.
- `allocator`: Define the allocator for malloc.
- `device_ctx`: Define device information during the runtime.
- Returns
The instance of MindSpore Lite Context.
```
~Context()
```
Destructor of MindSpore Lite Context.
**Public Attributes**
```
float16_priority
```
A **bool** value. Defaults to **false**. Prior enable float16 inference.
```
device_ctx_{DT_CPU}
```
A **DeviceContext** struct.
```
thread_num_
```
An **int** value. Defaults to **2**. Thread number config for thread pool.
```
allocator
```
A **std::shared_ptr<Allocator>** pointer.
```
cpu_bind_mode_
```
A **CpuBindMode** enum variable. Defaults to **MID_CPU**.
## ModelImpl ## ModelImpl
ModelImpl defines the implement class of Model in MindSpore Lite. ModelImpl defines the implement class of Model in MindSpore Lite.
...@@ -129,3 +198,62 @@ A **string** variable. ID of a node linked by this edge. ...@@ -129,3 +198,62 @@ A **string** variable. ID of a node linked by this edge.
outEdgeIndex outEdgeIndex
``` ```
A **size_t** variable. Index of this edge. A **size_t** variable. Index of this edge.
## CpuBindMode
An **enum** type. CpuBindMode defined for holding bind cpu strategy argument.
**Attributes**
```
MID_CPU = -1
```
Bind middle cpu first.
```
HIGHER_CPU = 1
```
Bind higher cpu first.
```
NO_BIND = 0
```
No bind.
## DeviceType
An **enum** type. DeviceType defined for holding user's preferred backend.
**Attributes**
```
DT_CPU = -1
```
CPU device type.
```
DT_GPU = 1
```
GPU device type.
```
DT_NPU = 0
```
NPU device type, not supported yet.
## DeviceContext
A **struct** . DeviceContext defined for holding DeviceType.
**Attributes**
```
type
```
A **DeviceType** variable. The device type.
## Version
```
std::string Version()
```
Global method to get a version string.
- Returns
The version string of MindSpore Lite.
\ No newline at end of file
...@@ -11,5 +11,6 @@ MindSpore Lite Documentation ...@@ -11,5 +11,6 @@ MindSpore Lite Documentation
:maxdepth: 1 :maxdepth: 1
architecture architecture
apicc/apicc
operator_list operator_list
glossary glossary
...@@ -36,6 +36,7 @@ MindSpore教程 ...@@ -36,6 +36,7 @@ MindSpore教程
advanced_use/synchronization_training_and_evaluation advanced_use/synchronization_training_and_evaluation
advanced_use/bert_poetry advanced_use/bert_poetry
advanced_use/optimize_the_performance_of_data_preparation advanced_use/optimize_the_performance_of_data_preparation
advanced_use/mobilenetv2_incremental_learning
.. toctree:: .. toctree::
:glob: :glob:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册