Package-level declarations

Properties

Link copied to clipboard

Returns the dimensions of the tensor, or an empty list if not available.

Link copied to clipboard

Returns the total number of elements in the tensor layout.

Functions

Link copied to clipboard

Returns the index of the maximum value in the FloatArray.

Link copied to clipboard

Calculates the Intersection over Union (IoU) of two bounding boxes.

Link copied to clipboard

Clamps the values in the FloatArray within the range [min, max].

Link copied to clipboard

Calculates the Cosine Similarity between two FloatArray vectors.

Link copied to clipboard
fun ByteArray.dequantize(scale: Float, zeroPoint: Int): FloatArray

Dequantizes the ByteArray into a FloatArray using the given scale and zeroPoint.

Link copied to clipboard

Calculates the Euclidean Distance between two FloatArray vectors.

Link copied to clipboard

Returns the TFBuffer for the input tensor at the specified index.

Link copied to clipboard

Returns the TFBuffer for the output tensor at the specified index.

Link copied to clipboard

Calculates the mean value of the FloatArray.

Link copied to clipboard

Normalizes the FloatArray using the given mean and std.

Link copied to clipboard
fun FloatArray.pad(before: Int, after: Int, value: Float = 0.0f): FloatArray

Adds padding to the FloatArray before and after its current content.

Link copied to clipboard
fun performNms(boxes: Array<FloatArray>, scores: FloatArray, iouThreshold: Float): List<Int>

Performs Non-Maximum Suppression (NMS) on a set of bounding boxes.

Link copied to clipboard
fun FloatArray.quantize(scale: Float, zeroPoint: Int): ByteArray

Quantizes the FloatArray into a ByteArray using the given scale and zeroPoint.

Link copied to clipboard

Reads a single Float value from the TFBuffer.

Link copied to clipboard
fun FloatArray.reshape(vararg dims: Int): FloatArray

Simulates a reshape operation on the FloatArray.

Link copied to clipboard

Computes the Sigmoid function for each element in the FloatArray.

Link copied to clipboard

Computes the Softmax probabilities for the FloatArray.

Link copied to clipboard

Calculates the standard deviation of the FloatArray.

Link copied to clipboard

Reads the content of the TFBuffer as a BooleanArray.

Converts a ByteArray to a BooleanArray (true if non-zero).

Link copied to clipboard

Reads the content of the TFBuffer as a ByteArray.

Converts a BooleanArray to a ByteArray (1 for true, 0 for false).

Converts a FloatArray to a ByteArray by rounding each element to the nearest Byte.

Link copied to clipboard
fun FloatArray.toCategories(labels: List<String>, threshold: Float = 0.0f): List<LiteRTExt.Category>

Converts the FloatArray scores into a list of LiteRTExt.Category.

Link copied to clipboard

Reads the content of the TFBuffer as a FloatArray.

Converts a ByteArray to a FloatArray.

Converts an IntArray to a FloatArray.

Link copied to clipboard

Reads the content of the TFBuffer as an IntArray.

Converts a FloatArray to an IntArray by rounding each element to the nearest Int.

Link copied to clipboard

Reads the content of the TFBuffer as a LongArray.

Link copied to clipboard

Returns the top k elements as a list of Pair(index, score).

Link copied to clipboard
suspend fun <T> LiteRTCompiler.use(block: suspend (LiteRTCompiler) -> T): T

Automatically closes the LiteRTCompiler after the block is executed.

Link copied to clipboard

Writes a single Float value into the TFBuffer.

Link copied to clipboard

Writes the BooleanArray data into the TFBuffer.

Writes the ByteArray data into the TFBuffer.

Writes the FloatArray data into the TFBuffer.

Writes the IntArray data into the TFBuffer.

Writes the LongArray data into the TFBuffer.