---
title: 函数：get_output_dims
description: "| C函数原型 | aclError aclmdlGetOutputDims(const aclmdlDesc \*modelDesc, size\_t index, aclmdlIODims \*dims) |"
url: https://www.hiascend.com/document/detail/zh/Atlas200IDKA2DeveloperKit/latest/Application%20Development%20Guide/aadgp/aclpythondevg_01_0191.html
sourcePath: /source/zh/Atlas200IDKA2DeveloperKit/23.0.RC2/Application Development Guide/aadgp/aclpythondevg_01_0191.html
indexId: bc3750b407881a2fc4f7ff4567c5f737d394c3e7b85bcbc985b3bd6f8857405a108
---
# 函数：get_output_dims

| C函数原型 | aclError aclmdlGetOutputDims(const aclmdlDesc \*modelDesc, size\_t index, aclmdlIODims \*dims) |
| --- | --- |
| Python函数 | dims, ret = acl.mdl.get\_output\_dims(model\_desc, index) |
| 函数功能 | 根据模型描述获取指定的模型输出tensor的维度信息。同步接口。 固定Shape场景下，通过该接口获取指定的模型输出tensor的维度信息。 动态Shape（动态Batch或动态分辨率）场景下，通过该接口获取最大档的维度信息。 |
| 输入说明 | model\_desc：int，aclmdlDesc类型数据的指针地址。 index：int，指定获取第几个输入的大小，index值从0开始。 |
| 返回值说明 | dims：dict，针对多batch或多种宽高的场景，按照该字典的数组返回其支持的最大档的组合。 dims = { "name": xxx, \#tensor name "dimCount":xxx，\#shape中的维度个数 "dims": [xx, xx, xx] \# 维度信息 } 若tensor的name长度大于127，则在输出dims.name时，pyACL会将tensor的name转换为“acl\_modelId\_${id}\_input\_${index}\_${随机字符串} ”格式（如果转换后的tensor的name与模型中已有的tensor的name冲突，则会在转换后的name尾部增加“\_${随机字符串} ”，否则不会增加随机字符串），并在转换后的name与原name之间建立映射关系，用户可调用acl.mdl.get\_tensor\_real\_name接口，传入转换后的name，获取原name（若向接口传入原name，则获取的还是原name）；若tensor的name长度小于或等于127，则在输出的dims.name时，按tensor的name输出。 ret：int，错误码。 返回0表示成功。 返回其它值表示失败。 |
| 约束说明 | 无 |
