aclSetTensorConst

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 a constant input for an operator and specifies the memory address for storing the input tensor data and address length.

Prototype

aclError aclSetTensorConst(aclTensorDesc *desc, void *dataBuffer, size_t length)

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.

dataBuffer

Input

Pointer to the memory address of the input tensor data.

In Ascend EP form, allocate memory on the host.

In Ascend RC form, allocate memory on the device.

In Open Ctrl CPU form, allocate memory on the device.

For details about the memory allocation APIs, see Memory Management.

length

Input

Length of the memory address, in bytes.

Returns

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