当前位置: 首页 > wzjs >正文

wordpress模板编辑首页杭州优化公司哪家好

wordpress模板编辑首页,杭州优化公司哪家好,我在某赌博网站做代理,成都最近爆发的传染病文章大纲 引言一、模型加载概述二、核心数据结构三、模型加载核心流程 引言 Mindspore 是一款华为开发开源的AI推理框架,而Mindspore Lite则是华为为了适配在移动终端设备上运行专门定制的版本,使得我们可以在OpenHarmony快速实现模型加载和推理等功能&…

文章大纲

  • 引言
  • 一、模型加载概述
  • 二、核心数据结构
  • 三、模型加载核心流程

引言

Mindspore 是一款华为开发开源的AI推理框架,而Mindspore Lite则是华为为了适配在移动终端设备上运行专门定制的版本,使得我们可以在OpenHarmony快速实现模型加载和推理等功能,模型加载则是利用 Mindspore Lite 进行推理任务的首要步骤,它犹如打开智能应用大门的钥匙,精准且高效地将预训练模型导入到运行环境中,为后续的推理计算奠定坚实基础。无论是在移动端的智能应用开发,还是边缘计算设备的智能任务处理,Mindspore Lite 加载模型的能力都直接影响着整个系统的运行效率与智能化表现,值得我们深入探究其原理、流程与优化策略,接下来就重点解读核心API 及其流程。

本文非Mindspore入门科普文,需要具备一定的Mindspore 知识。

一、模型加载概述

加载的本质就是把模型从文件Buffer 转为Mindspore 后续推理时所需要的模型的相关对象
CPU 方式直接加载的话就是直接通过本地设备的CPU完成这些工作,这些作为推理的输入直接使用;而通过NNRT 的话就是在CPU完成这第一步加载后,再把转换完成后的输出作为输入通过Delegate 模式再次进行转换,转为NNRT 所需要的模型的相关对象,再把这些NNRT的对象通过NNRT传递到NNRT HOST 进而传递到NPU中进行运算。

二、核心数据结构

Model 由LiteGraph 呈现,LiteGraph 保存着所有的Tensor列表、Node列表、SubGrapha列表和输出、输入的索引,LiteGraph 包含着Node、和SubGrapha,相当于所有的子结构信息都保存到LiteGraph中,每个子结构只保存各自的索引数据,计算后再通过索引从LiteGraph中获取得到对应的数据。图由多个Node构成,每一个Node 承担一个运算操作。比如一个计算图有两个节点NodeA(执行加法操作)和NodeB(执行乘法操作,输入来自NodeA的输出),NodeA 输出张量生成的索引将被记录在output_indices_ 表示这个节点的输出Tensor,NodeB 就使用NodeA 的输出索引作为输入以便获取计算所需的数据。

struct MS_API LiteGraph {struct Node {std::string name_;std::string op_type_;int node_type_;const void *primitive_ = nullptr;std::shared_ptr<void> base_operator_ = nullptr;std::vector<uint32_t> input_indices_;std::vector<uint32_t> output_indices_;int quant_type_;int device_type_ = -1;};struct SubGraph {std::string name_;std::vector<uint32_t> input_indices_;std::vector<uint32_t> output_indices_;std::vector<uint32_t> node_indices_;std::vector<uint32_t> tensor_indices_;};std::string name_;std::string version_;std::vector<uint32_t> input_indices_;std::vector<uint32_t> output_indices_;std::vector<mindspore::schema::Tensor *> all_tensors_;std::vector<Node *> all_nodes_;std::vector<SubGraph *> sub_graphs_;std::string ToString() const;
};struct MS_API Model {LiteGraph graph_;char *buf = nullptr;size_t buf_size_ = 0;LiteModelType model_type_ = mindspore::lite::ModelType_MSLite;void *deobf = nullptr;/// \brief Static method to create a Model pointer.static Model *Import(const char *model_buf, size_t size);/// \brief Static method to create a Model pointer.static Model *Import(const char *filename);/// \brief  method to export model to file.static int Export(Model *model, const char *filename);/// \brief  method to export model to buffer.static int Export(Model *model, char *buf, size_t *size);/// \brief Free meta graph temporary buffervirtual void Free() = 0;/// \brief Free all temporary buffer.EG: nodes in the model.virtual void Destroy() = 0;/// \brief Model destruct, free all memoryvirtual ~Model() = default;
};
Struct LiteGraph{struct Node {std::string name_;std::string op_type_;int node_type_;const void *primitive_ = nullptr;std::shared_ptr<void> base_operator_ = nullptr;std::vector<uint32_t> input_indices_;std::vector<uint32_t> output_indices_;int quant_type_;int device_type_ = -1;};struct SubGraph {std::string name_;std::vector<uint32_t> input_indices_;std::vector<uint32_t> output_indices_;std::vector<uint32_t> node_indices_;std::vector<uint32_t> tensor_indices_;};std::string name_;std::string version_;std::vector<uint32_t> input_indices_;std::vector<uint32_t> output_indices_;std::vector<mindspore::schema::Tensor *> all_tensors_;std::vector<Node *> all_nodes_;std::vector<SubGraph *> sub_graphs_;std::string ToString() const;
}
class MS_API LiteModel : public Model {...
}

三、模型加载核心流程

在这里插入图片描述未完待续…

http://www.dtcms.com/wzjs/131168.html

相关文章:

  • 普洱做网站的报价手机网站模板免费下载
  • 网站后台怎么添加栏目榆林seo
  • 专业的培训行业网站制作友情链接英语
  • 网站开发安全文档深圳企业网站制作公司
  • 香港公司建网站如何在各大平台推广
  • seo人员要先对网站进行诊断兰州网络推广与营销
  • 莆田个人外贸网站建设360收录批量查询
  • 好视通视频会议app下载安装优化近义词
  • 做海报哪个网站的素材多seo在线网站推广
  • 黑龙省建设厅网站首页郑州seo公司排名
  • 为什么自己做的网站uc打不开军事新闻最新消息今天
  • wordpress 拉取点击数广州seo全网营销
  • 铁岭网站建设公司南京百度网站快速优化
  • 上海智能网站建设设计软文广告经典案例200字
  • 08影院源码WordPress搜索引擎优化缩写
  • 手机网站商场建设鹤壁网站seo
  • 柳州市诚信体系建设网站武汉百度推广多少钱
  • 做彩票类网站用什么服务器鹤壁seo
  • 网站制作公司站建设社群推广平台
  • 大型自助建站平台seo网站分析报告
  • 男女做差差事的视频网站网站开发需要的技术
  • 专业的网页制作服务seo自动优化软件下载
  • 上海正规网站建设怎么样品牌推广的方式有哪些
  • 男女做暖暖的免费观看网站网站关键词优化排名外包
  • 安徽建筑管理人员信息网杭州seo网络推广
  • 个人免费建网站方法搜索引擎推广
  • 河南做网站汉狮百度seo刷排名工具
  • wordpress某个用户重定向关键词优化怎么写
  • 如何做网站模版腾讯朋友圈广告代理
  • 佛山专业做网站的公司线上培训