---
title: GraphParam
description: "图算子参数。"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/API/ascendtb/ascendtb_01_0016.html
sourcePath: /source/zh/canncommercial/900/API/ascendtb/ascendtb_01_0016.html
indexId: ef0983965eba75d580d2a3bdbbce68cbb95e0ec5e484e0e22ba809afeca5d66064
---
# GraphParam

#### 功能说明

图算子参数。


#### 定义

```
struct GraphParam {
    std::string name;
    uint32_t inTensorNum = 0;
    uint32_t outTensorNum = 0;
    uint32_t internalTensorNum = 0;
    std::vector<Node> nodes;
    InferShapeFunc inferShapeFunc = nullptr;
};
```


#### 参数列表

| 成员名称 | 数据类型 | 默认值 | 描述 |
| --- | --- | --- | --- |
| name | std::string | \- | 图算子名称。 仅允许字母、数字、下划线，名称长度不超过128。 |
| inTensorNum | uint32\_t | 0 | 图算子输入tensor的数量，需小于或等于256，传入不正确的Tensor数量将返回“ERROR\_INVALID\_IN\_TENSOR\_NUM”报错，具体请参见ErrorType。 |
| outTensorNum | uint32\_t | 0 | 图算子输出tensor的数量，需小于或等于256，传入不正确的Tensor数量将返回“ERROR\_INVALID\_IN\_TENSOR\_NUM”报错，具体请参见ErrorType。 |
| internalTensorNum | uint32\_t | 0 | 图算子中间tensor的数量，需小于或等于256，传入不正确的Tensor数量将返回“ERROR\_INVALID\_IN\_TENSOR\_NUM”报错，具体请参见ErrorType。 |
| nodes | std::vector<Node> | \- | 图算子Node Vector。 nodes的长度满足小于1024。 nodes的顺序，需要满足各个node对应operation的执行顺序依赖关系，先执行的在前面，后执行的在后面。 如果inTensorNum，outTensorNum与internalTensorNum之和为S，则nodes中各个元素的inTensorIds，outTensorIds中各元素值均要求落在[0, S\-1]范围内。 |
| inferShapeFunc | InferShapeFunc | nullptr | inferShape函数指针。 |
