aclSetTensorValueRange

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

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

1
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

Count of values that require range setting.

valueRange

Input

Value range, represented by a two-dimensional array.

#define ACL_TENSOR_VALUE_RANGE_NUM 2

Returns

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