aclGetTensorListSize

Description

Obtains the size of the aclTensorList created by calling aclCreateTensorList.

Prototype

aclnnStatus aclGetTensorListSize(const aclTensorList *tensorList, uint64_t *size)

Parameter Description

Parameter

Input/Output

Description

tensorList

Input

Source aclTensorList.

size

Output

Size of the aclTensorList.

Return Value

0 on success; otherwise, failure. For details about the return codes, see Common API Return Codes.

Possible causes:

  • Error code 161001: tensorList or size is a null pointer.

Constraints

None.

Example

The following sample code is for reference only. Do not copy and run it.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
// Create an aclTensorList.
std::vector<aclTensor *> tmp{input1, input2};
aclTensorList* tensorList = aclCreateTensorList(tmp.data(), tmp.size());
...
// Obtain the tensorList size.
uint64_t size = 0;
auto ret = aclGetTensorListSize(tensorList, &size); // The obtained tensorList size is 2.
...
// Destroy the aclTensorList.
ret = aclDestroyTensorList(tensorList);