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

#### 产品支持情况

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


#### 头文件/库文件

- 头文件：#include <ge/ge_ir_build.h>
- 库文件：libge_compiler.so


#### 功能说明

用于支持设置node属性方式的改图。


#### 函数原型

```
graphStatus aclgrphSetOpAttr(Graph &graph, aclgrphAttrType attr_type, const char_t *cfg_path)
```


#### 参数说明

| 参数名 | 输入/输出 | 说明 |
| --- | --- | --- |
| graph | 输入/输出 | 作为输入时，代表要通过属性方式修改的图； 作为输出时表示已经修改后的图。 |
| attr\_type | 输入 | attr\_type的枚举类型定义： enum aclgrphAttrType { ATTR\_TYPE\_KEEP\_DTYPE = 0, ATTR\_TYPE\_WEIGHT\_COMPRESS }; ATTR\_TYPE\_KEEP\_DTYPE：保持模型编译时个别算子的计算精度不变。 ATTR\_TYPE\_WEIGHT\_COMPRESS ：模型编译时对个别算子进行weight压缩。 |
| cfg\_path | 输出 | 配置文件路径。配置文件举例： 计算精度不变的文件格式为： Opname1 Opname2 … weight压缩文件格式为： Opname1;Opname2 |


#### 返回值说明

| 参数名 | 类型 | 说明 |
| --- | --- | --- |
| \- | graphStatus | GRAPH\_SUCCESS(0)：成功。 其他值：失败，详情请参见"ge::graphStatus(https://www.hiascend.comdocument/detail/zh/canncommercial/900/maintenref/basicdataapi/atlasopapi\_07\_00513.html)"。 |


#### 约束说明

无
