---
title: GetAttrValue
description: "| 产品 | 是否支持 |"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/API/ascendgraphapi/atlasgeapi_07_0587.html
sourcePath: /source/zh/canncommercial/900/API/ascendgraphapi/atlasgeapi_07_0587.html
indexId: b95823e5891126bfecdfbe7cc1ac733e43144f995f4301a5c5f2f94cf7d7896172
---
# GetAttrValue

#### 产品支持情况

| 产品 | 是否支持 |
| --- | --- |
| Atlas 350 加速卡 | √ |
| Atlas A3 训练系列产品 / Atlas A3 推理系列产品 | √ |
| Atlas A2 训练系列产品 / Atlas A2 推理系列产品 | √ |
| Atlas 200I/500 A2 推理产品 | √ |
| Atlas 推理系列产品 | √ |
| Atlas 训练系列产品 | √ |


#### 头文件

- 头文件：#include <graph/attr_value.h>
- 库文件：libgraph_base.so


#### 功能说明

获取属性的取值。泛型类，承载具体的属性类型。


#### 函数原型

```
graphStatus GetAttrValue(int64_t &attr_value) const
graphStatus GetAttrValue(float32_t &attr_value) const
graphStatus GetAttrValue(AscendString &attr_value) const
graphStatus GetAttrValue(bool &attr_value) const
graphStatus GetAttrValue(Tensor &attr_value) const
graphStatus GetAttrValue(std::vector<int64_t> &attr_value) const
graphStatus GetAttrValue(std::vector<float32_t> &attr_value) const
graphStatus GetAttrValue(std::vector<AscendString> &attr_values) const
graphStatus GetAttrValue(std::vector<bool> &attr_value) const
graphStatus GetAttrValue(std::vector<Tensor> &attr_value) const
graphStatus GetAttrValue(std::vector<std::vector<int64_t>> &attr_value) const
graphStatus GetAttrValue(std::vector<ge::DataType> &attr_value) const
graphStatus GetAttrValue(ge::DataType &attr_value) const
```


#### 参数说明

| 参数名 | 输入/输出 | 描述 |
| --- | --- | --- |
| attr\_value | 输出 | 具体的属性取值。 |


#### 返回值说明

graphStatus类型：成功，返回GRAPH_SUCCESS， 否则，返回GRAPH_FAILED。


#### 异常处理

无


#### 约束说明

无
