NumElements

Description

Obtains the number of tensor elements.

Prototype

int64_t NumElements() const

Parameters

None

Returns

An uint64_t for the number of tensor elements.

  • If the return value is greater than or equal to 0, the operation is successful.
  • If the return value is less than 0, the operation fails.

Restrictions

None

Example

uint64_t num = tensor->NumElements();