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

#### 产品支持情况

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


#### 头文件和库文件

- 头文件：#include <graph/operator.h>
- 库文件：libgraph.so


#### 功能说明

根据算子Input名称或Input索引获取算子Input的TensorDesc。


#### 函数原型

数据类型为string的接口后续版本会废弃，建议使用数据类型为非string的接口。


```
TensorDesc GetInputDesc(const std::string &name) const
TensorDesc GetInputDescByName(const char_t *name) const
TensorDesc GetInputDesc(uint32_t index) const
```


#### 参数说明

| 参数名 | 输入/输出 | 描述 |
| --- | --- | --- |
| name | 输入 | 算子Input名称。 当无此算子Input名称时，则返回TensorDesc默认构造的对象，其中，主要设置"DataType(https://www.hiascend.comdocument/detail/zh/canncommercial/900/maintenref/basicdataapi/atlasopapi\_07\_00514.html)"为DT\_FLOAT（表示float类型），"Format(https://www.hiascend.comdocument/detail/zh/canncommercial/900/maintenref/basicdataapi/atlasopapi\_07\_00515.html)"为FORMAT\_NCHW（表示NCHW）。 |
| index | 输入 | 算子Input索引。 当无此算子Input索引时，则返回TensorDesc默认构造的对象，其中，主要设置"DataType(https://www.hiascend.comdocument/detail/zh/canncommercial/900/maintenref/basicdataapi/atlasopapi\_07\_00514.html)"为DT\_FLOAT（表示float类型），"Format(https://www.hiascend.comdocument/detail/zh/canncommercial/900/maintenref/basicdataapi/atlasopapi\_07\_00515.html)"为FORMAT\_NCHW（表示NCHW）。 |


#### 返回值说明

算子Input的TensorDesc(https://www.hiascend.comdocument/detail/zh/canncommercial/900/maintenref/basicdataapi/atlasopapi_07_00429.html)。


#### 异常处理

无。


#### 约束说明

无。
