aclmdlGetInputDimsRange

Description

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

Prototype

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

Command-Line Options

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, starting from 0.

dimsRange

Output

Pointer to the input dimension information.

  • 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 when rank data is 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

The value 0 indicates success, and other values indicate failure. For details, see aclError.