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

#### 产品支持情况

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


#### 功能说明

IR属性定义结构体。


#### 结构说明

| 成员名 | 类型 | 说明 |  |  |
| --- | --- | --- | --- | --- |
| attr\_name | std::string | 属性名。 |  |  |
| ir\_attr\_type | IrAttrType | 属性类型。 |  |  |
| attr\_data\_type | std::string | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 const std::map<std::string, std::string> kIrAttrTypesMap = { {"Int", "VT\_INT"}, {"Float", "VT\_FLOAT"}, {"String", "VT\_STRING"}, {"Bool", "VT\_BOOL"}, {"Tensor", "VT\_TENSOR"}, {"NamedAttrs", "VT\_NAMED\_ATTRS"}, {"ListInt", "VT\_LIST\_INT"}, {"ListFloat", "VT\_LIST\_FLOAT"}, {"ListString", "VT\_LIST\_STRING"}, {"ListBool", "VT\_LIST\_BOOL"}, {"ListTensor", "VT\_LIST\_TENSOR"}, {"Bytes", "VT\_BYTES"}, {"ListListInt", "VT\_LIST\_LIST\_INT"}, {"ListNamedAttrs", "VT\_LIST\_NAMED\_ATTRS"}, {"Type", "VT\_DATA\_TYPE"}, {"ListType", "VT\_LIST\_DATA\_TYPE"}, } 取值为kIrAttrTypesMap中的key值。 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | const std::map<std::string, std::string> kIrAttrTypesMap = { {"Int", "VT\_INT"}, {"Float", "VT\_FLOAT"}, {"String", "VT\_STRING"}, {"Bool", "VT\_BOOL"}, {"Tensor", "VT\_TENSOR"}, {"NamedAttrs", "VT\_NAMED\_ATTRS"}, {"ListInt", "VT\_LIST\_INT"}, {"ListFloat", "VT\_LIST\_FLOAT"}, {"ListString", "VT\_LIST\_STRING"}, {"ListBool", "VT\_LIST\_BOOL"}, {"ListTensor", "VT\_LIST\_TENSOR"}, {"Bytes", "VT\_BYTES"}, {"ListListInt", "VT\_LIST\_LIST\_INT"}, {"ListNamedAttrs", "VT\_LIST\_NAMED\_ATTRS"}, {"Type", "VT\_DATA\_TYPE"}, {"ListType", "VT\_LIST\_DATA\_TYPE"}, } |
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | const std::map<std::string, std::string> kIrAttrTypesMap = { {"Int", "VT\_INT"}, {"Float", "VT\_FLOAT"}, {"String", "VT\_STRING"}, {"Bool", "VT\_BOOL"}, {"Tensor", "VT\_TENSOR"}, {"NamedAttrs", "VT\_NAMED\_ATTRS"}, {"ListInt", "VT\_LIST\_INT"}, {"ListFloat", "VT\_LIST\_FLOAT"}, {"ListString", "VT\_LIST\_STRING"}, {"ListBool", "VT\_LIST\_BOOL"}, {"ListTensor", "VT\_LIST\_TENSOR"}, {"Bytes", "VT\_BYTES"}, {"ListListInt", "VT\_LIST\_LIST\_INT"}, {"ListNamedAttrs", "VT\_LIST\_NAMED\_ATTRS"}, {"Type", "VT\_DATA\_TYPE"}, {"ListType", "VT\_LIST\_DATA\_TYPE"}, } |  |  |  |
| attr\_default\_value | AttrValue | 属性默认值。 |  |  |


#### 约束说明

无
