---
title: 函数：get_input_format
description: "| C函数原型 | aclFormat aclmdlGetInputFormat(const aclmdlDesc \*modelDesc, size\_t index) |"
url: https://www.hiascend.com/document/detail/zh/Atlas200IDKA2DeveloperKit/latest/Application%20Development%20Guide/aadgp/aclpythondevg_01_0194.html
sourcePath: /source/zh/Atlas200IDKA2DeveloperKit/23.0.RC2/Application Development Guide/aadgp/aclpythondevg_01_0194.html
indexId: 2654668b1160b8d24358eed7c06b70414b7ae255d10f62f6683e7572fd27e0ee108
---
# 函数：get_input_format

| C函数原型 | aclFormat aclmdlGetInputFormat(const aclmdlDesc \*modelDesc, size\_t index) |
| --- | --- |
| Python函数 | format\_info = acl.mdl.get\_input\_format(model\_desc, index) |
| 函数功能 | 获取模型中指定输入的Format。同步接口。 |
| 输入说明 | model\_desc：int，aclmdlDesc类型数据的指针地址。 index：int，指定获取第几个输入的大小，index值从0开始。 |
| 返回值说明 | format\_info：int，返回指定输入的Format。 \-1：ACL\_FORMAT\_UNDEFINED，未知格式，默认值。 0：ACL\_FORMAT\_NCHW，NCHW格式。 1：ACL\_FORMAT\_NHWC，NHWC格式。 2：ACL\_FORMAT\_ND，表示支持任意格式，仅有Square、Tanh等这些单输入对自身处理的算子外，其他需要慎用。 3：ACL\_FORMAT\_NC1HWC0，华为自研的5维数据格式。 4：ACL\_FORMAT\_FRACTAL\_Z，卷积的权重格式。 |
| 约束说明 | 无 |
