aclCreateTensorDesc

Description

Creates data of the aclTensorDesc type as a tensor description, describing the data type, shape, and format of a tensor.

To destroy data of the aclTensorDesc type, call aclDestroyTensorDesc.

Prototype

aclTensorDesc *aclCreateTensorDesc(aclDataType dataType,

int numDims,

const int64_t *dims,

aclFormat format)

Parameters

Parameter

Input/Output

Description

dataType

Input

Data type of the tensor description.

numDims

Input

Tensor dimension count.

numDims has the following restrictions:

  • numDims >= 0
  • If numDims > 0, then numDims must be the same as the length of the dims array.
  • If numDims = 0, the dims array is ignored.

dims

Input

Pointer to the dimensions in the tensor description.

Each element in the array corresponds to the size of a dimension in the tensor. If the value of an element is 0, the tensor is empty.

If you need to use an empty tensor, set the minimum memory size to 1 byte during memory allocation to ensure normal running of subsequent services.

format

Input

Tensor format.

Returns

Pointer to data of the aclTensorDesc type.