---
title: IsConstInput
description: "用于判断某个输入张量是否为常量数据。"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/maintenref/basicdataapi/atlasopapi_07_00692.html
sourcePath: /source/zh/canncommercial/900/maintenref/basicdataapi/atlasopapi_07_00692.html
indexId: 204b88df215c2735a670b874d2c7c474f12dd4dc438f286a90a1c938927fe68878
---
# IsConstInput

#### 函数功能

用于判断某个输入张量是否为常量数据。


#### 函数原型

```
bool IsConstInput(const ge::AscendString &name) const
```


#### 参数说明

| 参数 | 输入/输出 | 说明 |
| --- | --- | --- |
| name | 输入 | 输入张量的名称。 |


#### 返回值说明

true表示该输入是常量；false表示是动态输入（如输入数据、中间结果等）。


#### 约束说明

无


#### 调用示例

```
bool IsConstInput(ExeResGenerationContext *context) {
  ge::AscendString name = "XXX";
  bool status = *context->IsConstInput(name);
}
```
