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

网站页面设计效果图网络推广员一个月多少钱

网站页面设计效果图,网络推广员一个月多少钱,企业网页设计素材,北京燕郊网站建设文章大纲 引言一、模型加载概述二、核心数据结构三、模型加载核心流程 引言 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/463774.html

相关文章:

  • 重庆合川企业网站建设无锡网站建设seo
  • 网站编辑的栏目怎么做上海公司排名
  • 网站建设公司哪家好东莞关键词优化平台
  • 免费p站推广网站入口手机网站模板建站
  • 彩票网站的推荐怎么做谷歌seo推广招聘
  • 松江做网站公司上海优质网站seo有哪些
  • 做一个微信小程序要多少钱优化关键词的方法正确的是
  • 设计公司网站多少钱网站推广四个阶段
  • 汕头网站设计怎么开发网站
  • 想学Wordpress建站百度热门关键词排名
  • 服装公众号的手机网站怎么做google搜索首页
  • wordpress插件无法安装如何进行网站性能优化
  • 工作计划范文关键词优化快排
  • 怎么做网站公众号百度宣传做网站多少钱
  • 晋中市建设局网站营销网站建设网站开发
  • 电子商务网站建设与维护的考试seo关键字排名优化
  • 网站开发课程改革中山疫情最新消息
  • 要加强县门户网站的建设管理网络营销策略的内容
  • 长垣高端建站暴风seo论坛
  • 怎么样建设网站爱站长
  • 深圳宝安区深圳网站建设 骏域网络软件开发培训机构排名
  • 做网站一般用什么 语言运营推广是做什么的
  • 网站建设需要用到哪些技术百度快照投诉中心
  • 主流网站开发工具巩义网站推广优化
  • 在线编辑图片软件优化seo是什么
  • 教育网站 模板域名查询系统
  • 多种东莞微信网站建设网易疫情实时最新数据
  • 贵阳有做网站的公司吗西安网站关键词优化费用
  • 网站建设教程试题我想接app注册推广单
  • python做后台开发移动网站应用商店aso