函数:get_output_dims
产品支持情况
产品  | 
是否支持  | 
|---|---|
√  | 
|
√  | 
|
√  | 
|
√  | 
|
√  | 
功能说明
根据模型描述获取指定的模型输出Tensor的维度信息。
- 固定Shape场景下,通过该接口获取指定的模型输出Tensor的维度信息。
 - 动态Shape(动态Batch或动态分辨率)场景下,通过该接口获取最大档的维度信息。
 
函数原型
- C函数原型
1aclError aclmdlGetOutputDims(const aclmdlDesc *modelDesc, size_t index, aclmdlIODims *dims)
 - python函数
1dims, ret = acl.mdl.get_output_dims(model_desc, index)
 
参数说明
参数名  | 
说明  | 
|---|---|
model_desc  | 
int,aclmdlDesc类型数据的指针地址。 需提前调用acl.mdl.create_desc接口创建aclmdlDesc类型的数据。  | 
index  | 
int,指定获取第几个输入的大小,index值从0开始。  | 
返回值说明
返回值  | 
说明  | 
|---|---|
dims  | 
dict,针对多batch或多种宽高的场景,按照该字典的数组返回其支持的最大档的组合,具体请参见aclmdlIODims。 dims = {
        "name": xxx, #tensor name
        "dimCount":xxx,#shape中的维度个数
        "dims": [xx, xx, xx]   # 维度信息
        }
  | 
ret  | 
int,错误码。 
  | 
父主题: aclmdlDesc