aclSetTensorConst

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

Sets a constant input for an operator and specifies the memory address for storing the input tensor data and address length.

Prototype

1
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 Ctrl CPU open form, allocate memory on the device.

length

Input

Length of the memory address, in bytes.

Returns

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