LibraryLink`
LibraryLink`

MTensor_getFlattenedLength (C Function)

gets the total number of elements in an MTensor.

Details

  • Used in C/C++ code in a library function called from the Wolfram Language.
  • This is the length of a flattened version of the MTensor.

Examples

Basic Examples  (1)

This gets the total number of elements of an MTensor:

MTensor T0;
mint len;
...
len = libData->MTensor_getFlattenedLength( T0);