aclmdlGetInputDimsRange

Applicable Products

Product

Supported

Ascend 950PR/Ascend 950DT

√

Atlas A3 training products/Atlas A3 inference products

√

Atlas A2 training products/Atlas A2 inference products

√

Atlas 200I/500 A2 inference products

√

Atlas inference products

√

Atlas training products

√

Function Usage

Obtains the dimension range of an input tensor based on the model description.

Prototype

1
aclError aclmdlGetInputDimsRange(const aclmdlDesc *modelDesc, size_t index, aclmdlIODimsRange *dimsRange)

Parameters

Parameter

Input/Output

Description

modelDesc

Input

Pointer to data of the aclmdlDesc type.

Call aclmdlCreateDesc to create data of the aclmdlDesc type in advance.

index

Input

Index of the input dimension information to be obtained, indexed from 0.

dimsRange

Output

Pointer to the input dimension information. For details about the type definition, see aclmdlIODimsRange.

  • Returns the shape range when the dynamic shape is used and the shape range is configured. The dynamic dimension upper and lower limits are different, but the static dimension upper and lower limits are the same.

    For example, if format of the input tensor is NCHW, dims is [1, 3, 10–224, 10–300], the N and C dimensions are fixed values, and the H and W dimensions are dynamic ranges, then aclmdlIODimsRange.rangeCount is 4, the aclmdlIODimsRange.range array contains four elements: {1, 1}, {3, 3}, {10, 224}, and {10, 300}.

  • This API is not supported in the dynamic-shape scenario with profiles configured. The aclmdlIODimsRange.rangeCount returns 0.
  • In the static-shape scenario, the shape range is returned, but the upper and lower limits of each dimension are the same.

Returns

0 on success; else, failure. For details, see aclError.