|
nndeploy C++ API
0.2.0
nndeploy C++ API
|
#include <interpret.h>
Public Member Functions | |
| base::Status | dump (std::ostream &oss=std::cout) |
| ModelDesc * | getModelDesc () |
| 获取模型描述 More... | |
| virtual base::Status | interpret (const std::vector< std::string > &model_value, const std::vector< ValueDesc > &input=std::vector< ValueDesc >())=0 |
| 解释模型 More... | |
| Interpret (ModelDesc *model_desc=nullptr, bool is_external=false) | |
| 解释器类的默认构造函数 More... | |
| base::Status | saveModelToFile (const std::string &structure_file_path, const std::string &weight_file_path) |
| 存储模型结构以及模型权重 More... | |
| virtual | ~Interpret () |
| 虚析构函数 More... | |
Public Attributes | |
| bool | is_external_ = false |
| 是否是外部模型 More... | |
| ModelDesc * | model_desc_ = nullptr |
| 模型描述 More... | |
Definition at line 10 of file interpret.h.
|
explicit |
解释器类的默认构造函数
创建一个新的Interpret对象,并初始化model_desc_成员。 model_desc_被初始化为一个新的ModelDesc对象。
解释器类的带参构造函数
使用已有的model_desc创建一个新的Interpret对象。
|
virtual |
虚析构函数
负责清理Interpret对象,释放model_desc_指针指向的内存
| base::Status nndeploy::ir::Interpret::dump | ( | std::ostream & | oss = std::cout | ) |
| ModelDesc* nndeploy::ir::Interpret::getModelDesc | ( | ) |
获取模型描述
获取模型描述
|
pure virtual |
解释模型
该函数负责解释输入的模型,将其转换为内部的中间表示(IR)格式。 这个过程通常包括解析模型结构、提取参数、分析计算图等步骤。
| model_value | 包含模型信息的字符串向量。可能包含模型文件路径、序列化的模型数据等。 |
| input | 模型输入的描述信息。默认为空向量,表示使用模型的默认输入配置。 当需要自定义输入时,可以通过此参数指定。 |
Implemented in nndeploy::ir::DefaultInterpret.
| base::Status nndeploy::ir::Interpret::saveModelToFile | ( | const std::string & | structure_file_path, |
| const std::string & | weight_file_path | ||
| ) |
存储模型结构以及模型权重
该函数负责将模型的结构和权重存储到指定的输出流中。 这个过程通常包括序列化模型结构、序列化模型权重等步骤。
| structure_stream | 输出流,用于存储模型结构的序列化数据。 |
| weight_file_path | 输出流,用于存储模型权重的序列化数据。 |
存储模型结构以及模型权重到指定路径
该函数负责将模型的结构和权重存储到指定的输出流中。 这个过程通常包括序列化模型结构、序列化模型权重等步骤。
| structure_file_path | 输出流,用于存储模型结构的序列化数据。 |
| weight_file_path | 输出流,用于存储模型权重的序列化数据。 |
| bool nndeploy::ir::Interpret::is_external_ = false |
是否是外部模型
Definition at line 130 of file interpret.h.
| ModelDesc* nndeploy::ir::Interpret::model_desc_ = nullptr |