Function: get_input_dims_range

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product/Atlas A3 inference product

Atlas A2 training product/Atlas A2 inference product

Atlas training product

Atlas inference product

Atlas 200I/500 A2 inference product

Function Usage

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

Prototype

  • C Prototype
    1
    aclError aclmdlGetInputDimsRange(const aclmdlDesc *modelDesc, size_t index, aclmdlIODimsRange *dimsRange)
    
  • Python Function
    1
    dims_range, ret = acl.mdl.get_input_dims_range(model_desc, index)
    

Parameters

Parameter

Description

model_desc

Int, pointer to data of the aclmdlDesc type.

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

index

Int, index of the input dimension information to be obtained, starting from 0.

Returns

Return Value

Description

dims_range

Dict, dictionary of input dimension information. 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 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.

ret

Int, 0 on success; else, failure.