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

#### 产品支持情况

| 产品 | 是否支持 |
| --- | --- |
| 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


#### 功能说明

根据单算子信息或单算子JSON文件构建Graph。


#### 函数原型

```
graphStatus aclgrphGenerateForOp(const AscendString &op_type, const std::vector<TensorDesc> &inputs, const std::vector<TensorDesc> &outputs, Graph &graph)
graphStatus aclgrphGenerateForOp(const AscendString &json_path, std::vector<Graph> &graphs)
```


#### 参数说明

| 参数名 | 输入/输出 | 说明 |
| --- | --- | --- |
| op\_type | 输入 | 算子类型。 |
| inputs | 输入 | 算子的输入Tensor格式列表。 |
| outputs | 输入 | 算子的输出Tensor格式列表。 |
| json\_path | 输入 | 单算子的JSON文件路径。 |
| graph | 输出 | 生成的Graph。 |
| graphs | 输出 | 生成的Graph列表。 |


#### 返回值说明

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


#### 约束说明

无
