CANN/ge获取输出属性API

📅 2026/6/20 11:28:37
CANN/ge获取输出属性API
GetOutputAttr【免费下载链接】geGEGraph 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::vectorAscendString attr_value) const graphStatus GetOutputAttr(const char_t *dst_name, const char_t *name, std::vectorAscendString attr_value) const graphStatus GetOutputAttr(const int32_t index, const char_t *name, std::vectorint64_t attr_value) const graphStatus GetOutputAttr(const char_t *dst_name, const char_t *name, std::vectorint64_t attr_value) const graphStatus GetOutputAttr(const int32_t index, const char_t *name, std::vectorint32_t attr_value) const graphStatus GetOutputAttr(const char_t *dst_name, const char_t *name, std::vectorint32_t attr_value) const graphStatus GetOutputAttr(const int32_t index, const char_t *name, std::vectoruint32_t attr_value) const graphStatus GetOutputAttr(const char_t *dst_name, const char_t *name, std::vectoruint32_t attr_value) const graphStatus GetOutputAttr(const int32_t index, const char_t *name, std::vectorbool attr_value) const graphStatus GetOutputAttr(const char_t *dst_name, const char_t *name, std::vectorbool attr_value) const graphStatus GetOutputAttr(const int32_t index, const char_t *name, std::vectorfloat32_t attr_value) const graphStatus GetOutputAttr(const char_t *dst_name, const char_t *name, std::vectorfloat32_t attr_value) const参数说明参数名输入/输出描述name输入属性名称。index输入输出索引。dst_name输入输出边名称。attr_value输出获取到的int64_t表示的整型类型属性值。attr_value输出获取到的int32_t表示的整型类型属性值。attr_value输出获取到的uint32_t表示的整型类型属性值。attr_value输出获取到的vectorint64_t表示的整型列表类型属性值。attr_value输出获取到的vectorint32_t表示的整型列表类型属性值。attr_value输出获取到的vectoruint32_t表示的整型列表类型属性值。attr_value输出获取到的浮点类型的属性值。attr_value输出获取到的浮点列表类型的属性值。attr_value输出获取到的布尔类型的属性值。attr_value输出获取到的布尔列表类型的属性值。attr_value输出获取到的字符串类型的属性值。attr_value输出获取到的字符串列表类型的属性值。返回值说明graphStatus类型找到对应属性返回GRAPH_SUCCESS否则返回GRAPH_FAILED。异常处理无。约束说明无。【免费下载链接】geGEGraph Engine是面向昇腾的图编译器和执行器提供了计算图优化、多流并行、内存复用和模型下沉等技术手段加速模型执行效率减少模型内存占用。 GE 提供对 PyTorch、TensorFlow 前端的友好接入能力并同时支持 onnx、pb 等主流模型格式的解析与编译。项目地址: https://gitcode.com/cann/ge创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考