aclSetTensorConst

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 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.

length

Input

Length of the memory address, in bytes.

Returns

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

Restrictions

In Ascend EP form, allocate memory on the host for dataBuffer.

In Ascend RC form, allocate memory on the device for dataBuffer.

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