SetInput
【免费下载链接】geGE(Graph Engine)是面向昇腾的图编译器和执行器,提供了计算图优化、多流并行、内存复用和模型下沉等技术手段,加速模型执行效率,减少模型内存占用。 GE 提供对 PyTorch、TensorFlow 前端的友好接入能力,并同时支持 onnx、pb 等主流模型格式的解析与编译。项目地址: https://gitcode.com/cann/ge
产品支持情况
头文件和库文件
- 头文件:#include <graph/operator.h>
- 库文件:libgraph.so
功能说明
设置算子Input,即由哪个算子的输出连到本算子。
有如下几种SetInput方法:
如果指定srcOprt第0个Output为当前算子Input,使用第一个函数原型设置当前算子Input,不需要指定srcOprt的Output名称。
如果指定srcOprt的其它Output为当前算子Input,使用第二个函数原型设置当前算子Input,需要指定srcOprt的Output名称。
如果指定srcOprt的其它Output为当前算子Input,使用第三个函数原型设置当前算子Input,需要指定srcOprt的第index个Output。
函数原型
[!NOTE]说明 数据类型为string的接口后续版本会废弃,建议使用数据类型为非string的接口。
Operator &SetInput(const std::string &dst_name, const Operator &src_oprt) Operator &SetInput(const char_t *dst_name, const Operator &src_oprt) Operator &SetInput(const std::string &dst_name, const Operator &src_oprt, const std::string &name) Operator &SetInput(const char_t *dst_name, const Operator &src_oprt, const char_t *name) Operator &SetInput(const std::string &dst_name, const Operator &src_oprt, uint32_t index) Operator &SetInput(const char_t *dst_name, const Operator &src_oprt, uint32_t index) Operator &SetInput(uint32_t dst_index, const Operator &src_oprt, uint32_t src_index) Operator &SetInput(const char_t *dst_name, uint32_t dst_index, const Operator &src_oprt, const char_t *name) Operator &SetInput(const char_t *dst_name, uint32_t dst_index, const Operator &src_oprt)参数说明
返回值说明
当前调度者本身。
异常处理
无。
约束说明
无。
【免费下载链接】geGE(Graph Engine)是面向昇腾的图编译器和执行器,提供了计算图优化、多流并行、内存复用和模型下沉等技术手段,加速模型执行效率,减少模型内存占用。 GE 提供对 PyTorch、TensorFlow 前端的友好接入能力,并同时支持 onnx、pb 等主流模型格式的解析与编译。项目地址: https://gitcode.com/cann/ge
创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考