aclSetTensorValueRange

Applicability

Product

Supported

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

Description

Sets the value range of a tensor after a tensor description is created by the aclCreateTensorDesc call.

Application scenario: For some operators, the input value is also the output shape. However, in the dynamic shape scenario, the shape has a value range. When executing an operator, you need to set the shape value range for the input (for example, [[16, 16], [1, 128], [20, 20], [1, 10]]). Only in this way can you properly build and execute operators.

Prototype

aclError aclSetTensorValueRange(aclTensorDesc* desc, size_t valueCount, int64_t valueRange[][ACL_TENSOR_VALUE_RANGE_NUM])

Parameters

Parameter

Input/Output

Description

desc

Output

Pointer to data of the aclTensorDesc type.

Call aclCreateTensorDesc to create data of the aclTensorDesc type in advance.

valueCount

Input

Number of data values whose range needs to be set.

valueRange

Input

Range of each value. A 2D array is used to indicate the range.

#define ACL_TENSOR_VALUE_RANGE_NUM 2

Returns

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