---
title: Init
description: "初始化图算子。"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/API/ascendtb/ascendtb_01_0109.html
sourcePath: /source/zh/canncommercial/900/API/ascendtb/ascendtb_01_0109.html
indexId: e752a0e606e96914c32b01db675b1c98fad81fa24480921a8f1c4a44f40228c164
---
# Init

#### 功能说明

初始化图算子。

定义图算子的名称，输入输出及shape传导规则。


#### 定义

```
virtual Status Init (const std::string &opName, const InferShapeFunc &inferShapeFunc, const SVector<std::string> &inTensorNames, const SVector<std::string> &outTensorNames)=0
```


#### 成员

| 成员名称 | 描述 |
| --- | --- |
| opName | 图算子的名称。 |
| inferShapeFunc | 图算子的shape传导规则。 |
| inTensorNames | 输入tensor名称。 |
| outTensorNames | 输出tensor名称。 |


#### 返回值

状态值。如果设置成功，返回NO_ERROR。
