Function: create_tensor_desc
Applicability
Product |
Supported (√/x) |
|---|---|
√ |
|
√ |
|
√ |
|
√ |
|
√ |
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.
Prototype
- C Prototype
1aclTensorDesc *aclCreateTensorDesc(aclDataType dataType, int numDims, const int64_t *dims, aclFormat format)
- Python Function
1tensor_desc = acl.create_tensor_desc(data_type, dims, format)
Parameter Description
Parameter |
Description |
|---|---|
data_type |
Int, data type of the tensor description. |
dims |
List, size of the specified dimensions 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 Description
Return Value |
Description |
|---|---|
tensor_desc |
Int, address object for creating the tensor description. |