getTensorShapeElementCount method

Pointer<OrtStatus> getTensorShapeElementCount(
  1. Pointer<OrtTensorTypeAndShapeInfo> info,
  2. Pointer<Size> out
)

Implementation

Pointer<OrtStatus> getTensorShapeElementCount(
  Pointer<OrtTensorTypeAndShapeInfo> info,
  Pointer<Size> out,
) {
  final getTensorShapeElementCountFn =
      GetTensorShapeElementCount.asFunction<
        Pointer<OrtStatus> Function(
          Pointer<OrtTensorTypeAndShapeInfo>,
          Pointer<Size>,
        )
      >();
  final status = getTensorShapeElementCountFn(info, out);
  if (status.isError) {
    final error =
        'Get tensor shape element count failed. Code: ${getErrorCodeMessage(status)}\n'
        'Message: ${consumeErrorMessage(status)}';
    throw Exception(error);
  }
  return status;
}