TensorBuffer

class TensorBuffer : JniHandle

TensorBuffer represents the raw memory where tensor data is stored.

Summary

Protected functions

open Unit

Clean up resources associated with the handle.

Inherited functions

From com.google.ai.edge.litert.JniHandle
Unit

Asserts that the handle is not destroyed, otherwise throws an IllegalStateException.

final Unit

Clean up the handle safely to avoid releasing the same JNI handle multiple times.

Public functions

readBoolean

fun readBoolean(): BooleanArray

readFloat

fun readFloat(): FloatArray

readInt

fun readInt(): IntArray

readInt8

fun readInt8(): ByteArray

readLong

fun readLong(): LongArray

writeBoolean

fun writeBoolean(data: BooleanArray): Unit

writeFloat

fun writeFloat(data: FloatArray): Unit

writeInt

fun writeInt(data: IntArray): Unit

writeInt8

fun writeInt8(data: ByteArray): Unit

writeLong

fun writeLong(data: LongArray): Unit

Protected functions

destroy

protected open fun destroy(): Unit

Clean up resources associated with the handle.