Count Number of Elements¶
Function counts the number of elements in a tensor starting from the provided dimension number (dimension numbering starts from 0):
- \(num\_ of\_ elements\) - number of accounting elements
- \(shape\) - shape of tensor
- \(start\_ dim\) – start dimension for counting
- \(last\_ dim\) - last dimension of tensor (tensor rank-1)
This function calculates total number of elements in case
start_dim = 0. Function returns 0 if conditions listed
in the following API are violated.
uint32_t mli_hlp_count_elem_num( mli_tensor *in, uint32_t start_dim )
Conditions for Applying the Function¶
- Input must contain valid rank (less then
start_dimmust be less than or equal to input rank.