Function: create_tensor_desc

C Prototype

aclTensorDesc *aclCreateTensorDesc(aclDataType dataType, int numDims, const int64_t *dims, aclFormat format)

Python Function

tensor_desc = acl.create_tensor_desc(data_type, dims, format)

Function Usage

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 Function: destroy_tensor_desc.

Input Description

data_type: int, data type of the tensor description.

dims: int list, size of a specified dimension of the tensor description. dims is a list of ints. Each element in the list indicates the size of each 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: int, format of the tensor description.

Return Value

tensor_desc: int, address object for creating the tensor description.

Restrictions

None