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

#### 产品支持情况

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


#### 功能说明

创建uint32常量张量。


#### 函数原型

```
create_const_uint32(value: Union[int, List[int]], shape: Optional[List[int]] = None) -> TensorHolder
```


#### 参数说明

| 参数名 | 输入/输出 | 描述 |
| --- | --- | --- |
| value | 输入 | 单个整数或整数列表。 |
| shape | 输入 | 可选参数，形状维度。 |


#### 返回值说明

(TensorHolder)表示常量的张量持有者。


#### 约束说明

- 如果是列表且提供了shape，元素数量必须与shape维度的乘积匹配。
- 如果value不是int或int列表，抛出TypeError。
- 如果值数量与形状不匹配，抛出ValueError。
- 如果常量创建失败，抛出RuntimeError。
