aclmdlGetInputDimsRange

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product/Atlas A3 inference product

Atlas A2 training product/Atlas A2 inference product

Atlas 200I/500 A2 inference product

Atlas inference product

Atlas training product

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.