news 2026/6/20 11:28:30

CANN/ge获取输出属性API

作者头像

张小明

前端开发工程师

1.2k 24
文章封面图
CANN/ge获取输出属性API

GetOutputAttr

【免费下载链接】geGE(Graph Engine)是面向昇腾的图编译器和执行器,提供了计算图优化、多流并行、内存复用和模型下沉等技术手段,加速模型执行效率,减少模型内存占用。 GE 提供对 PyTorch、TensorFlow 前端的友好接入能力,并同时支持 onnx、pb 等主流模型格式的解析与编译。项目地址: https://gitcode.com/cann/ge

产品支持情况

产品

是否支持

Atlas A3 训练系列产品 / Atlas A3 推理系列产品

Atlas A2 训练系列产品 / Atlas A2 推理系列产品

头文件和库文件

  • 头文件:#include <graph/operator.h>
  • 库文件:libgraph.so

功能说明

根据属性名称获取算子输出Tensor对应的属性值。

函数原型

graphStatus GetOutputAttr(const int32_t index, const char_t *name, AscendString &attr_value) const graphStatus GetOutputAttr(const char_t *dst_name, const char_t *name, AscendString &attr_value) const graphStatus GetOutputAttr(const int32_t index, const char_t *name, int64_t &attr_value) const graphStatus GetOutputAttr(const char_t *dst_name, const char_t *name, int64_t &attr_value) const graphStatus GetOutputAttr(const int32_t index, const char_t *name, int32_t &attr_value) const graphStatus GetOutputAttr(const char_t *dst_name, const char_t *name, int32_t &attr_value) const graphStatus GetOutputAttr(const int32_t index, const char_t *name, uint32_t &attr_value) const graphStatus GetOutputAttr(const char_t *dst_name, const char_t *name, uint32_t &attr_value) const graphStatus GetOutputAttr(const int32_t index, const char_t *name, bool &attr_value) const graphStatus GetOutputAttr(const char_t *dst_name, const char_t *name, bool &attr_value) const graphStatus GetOutputAttr(const int32_t index, const char_t *name, float32_t &attr_value) const graphStatus GetOutputAttr(const char_t *dst_name, const char_t *name, float32_t &attr_value) const graphStatus GetOutputAttr(const int32_t index, const char_t *name, std::vector<AscendString> &attr_value) const graphStatus GetOutputAttr(const char_t *dst_name, const char_t *name, std::vector<AscendString> &attr_value) const graphStatus GetOutputAttr(const int32_t index, const char_t *name, std::vector<int64_t> &attr_value) const graphStatus GetOutputAttr(const char_t *dst_name, const char_t *name, std::vector<int64_t> &attr_value) const graphStatus GetOutputAttr(const int32_t index, const char_t *name, std::vector<int32_t> &attr_value) const graphStatus GetOutputAttr(const char_t *dst_name, const char_t *name, std::vector<int32_t> &attr_value) const graphStatus GetOutputAttr(const int32_t index, const char_t *name, std::vector<uint32_t> &attr_value) const graphStatus GetOutputAttr(const char_t *dst_name, const char_t *name, std::vector<uint32_t> &attr_value) const graphStatus GetOutputAttr(const int32_t index, const char_t *name, std::vector<bool> &attr_value) const graphStatus GetOutputAttr(const char_t *dst_name, const char_t *name, std::vector<bool> &attr_value) const graphStatus GetOutputAttr(const int32_t index, const char_t *name, std::vector<float32_t> &attr_value) const graphStatus GetOutputAttr(const char_t *dst_name, const char_t *name, std::vector<float32_t> &attr_value) const

参数说明

参数名

输入/输出

描述

name

输入

属性名称。

index

输入

输出索引。

dst_name

输入

输出边名称。

attr_value

输出

获取到的int64_t表示的整型类型属性值。

attr_value

输出

获取到的int32_t表示的整型类型属性值。

attr_value

输出

获取到的uint32_t表示的整型类型属性值。

attr_value

输出

获取到的vector<int64_t>表示的整型列表类型属性值。

attr_value

输出

获取到的vector<int32_t>表示的整型列表类型属性值。

attr_value

输出

获取到的vector<uint32_t>表示的整型列表类型属性值。

attr_value

输出

获取到的浮点类型的属性值。

attr_value

输出

获取到的浮点列表类型的属性值。

attr_value

输出

获取到的布尔类型的属性值。

attr_value

输出

获取到的布尔列表类型的属性值。

attr_value

输出

获取到的字符串类型的属性值。

attr_value

输出

获取到的字符串列表类型的属性值。

返回值说明

graphStatus类型:找到对应属性,返回GRAPH_SUCCESS,否则返回GRAPH_FAILED。

异常处理

无。

约束说明

无。

【免费下载链接】geGE(Graph Engine)是面向昇腾的图编译器和执行器,提供了计算图优化、多流并行、内存复用和模型下沉等技术手段,加速模型执行效率,减少模型内存占用。 GE 提供对 PyTorch、TensorFlow 前端的友好接入能力,并同时支持 onnx、pb 等主流模型格式的解析与编译。项目地址: https://gitcode.com/cann/ge

创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考

版权声明: 本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若内容造成侵权/违法违规/事实不符,请联系邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!
网站建设 2026/6/20 11:27:10

深入解析NXP SB0800 SPI接口:从硬件连接到故障诊断的嵌入式驱动实践

1. 项目概述与核心价值在汽车电子和工业控制领域&#xff0c;驱动器的可靠性和精确控制是系统设计的基石。NXP的SB0800作为一款集成了高边驱动、低边驱动和泵驱动的智能功率开关&#xff0c;其核心控制与状态监控都依赖于一个精心设计的SPI接口。这个接口远不止是简单的数据收发…

作者头像 李华
网站建设 2026/6/20 11:09:13

小红书内容采集与备份:四步高效管理你的数字收藏

小红书内容采集与备份&#xff1a;四步高效管理你的数字收藏 【免费下载链接】XHS-Downloader 小红书&#xff08;XiaoHongShu、RedNote&#xff09;链接提取/作品采集工具&#xff1a;提取账号发布、收藏、点赞、专辑作品链接&#xff1b;提取搜索结果作品、用户链接&#xff…

作者头像 李华
网站建设 2026/6/20 11:08:32

QVariant 完整详细介绍

目录 QVariant 完整详细介绍 一、什么是 QVariant 核心定位 二、支持存储的所有类型大类 1. 基础 C++ 原生类型 2. Qt 内置基础类型 3. 对象指针(QObject 子类) 4. 自定义结构体 / 类 三、基础用法:存入、取出、类型判断 1. 存入数据(构造 /setValue) 2. 取出数…

作者头像 李华
网站建设 2026/6/20 11:08:18

3分钟掌握SiYuan笔记:终极特殊符号输入技巧指南

3分钟掌握SiYuan笔记&#xff1a;终极特殊符号输入技巧指南 【免费下载链接】siyuan A privacy-first, self-hosted, fully open source personal knowledge management software, written in typescript and golang. 项目地址: https://gitcode.com/GitHub_Trending/si/siyu…

作者头像 李华
网站建设 2026/6/20 11:05:32

从术语表到架构蓝图:深度解析MC68HC912BD32微控制器核心机制

1. 项目概述&#xff1a;从术语表到架构蓝图拿到一份芯片的技术手册&#xff0c;尤其是像MC68HC912BD32这样的老牌16位微控制器&#xff08;MCU&#xff09;的文档&#xff0c;很多工程师的第一反应可能是直接翻到电气特性、引脚定义或者具体模块的寄存器描述部分。这当然没错&…

作者头像 李华