OrtSessionResultConversions

object OrtSessionResultConversions

Convenience functions for processing OrtSession.Result.

Functions

get2DFloatArray
Link copied to clipboard
common
fun <ERROR CLASS>.get2DFloatArray(index: Int): Array<FloatArray>

Returns the output at index as an Array. This operation could be slow for high dimensional tensors, in which case getFloatArray should be used.

fun <ERROR CLASS>.get2DFloatArray(name: String): Array<FloatArray>

Returns the output by name as an Array. This operation could be slow for high dimensional tensors, in which case getFloatArray should be used.

getByteArray
Link copied to clipboard
common
fun <ERROR CLASS>.getByteArray(index: Int): ByteArray

Returns the output at index as a ByteArray.

fun <ERROR CLASS>.getByteArray(name: String): ByteArray

Returns the output by name as a ByteArray.

getByteArrayWithShape
Link copied to clipboard
common
fun <ERROR CLASS>.getByteArrayWithShape(index: Int): <ERROR CLASS><ByteArray, LongArray>

Returns the output at index as a ByteArray with its shape.

fun <ERROR CLASS>.getByteArrayWithShape(name: String): <ERROR CLASS><ByteArray, LongArray>

Returns the output by name as a ByteArray with its shape.

getDoubleArray
Link copied to clipboard
common
fun <ERROR CLASS>.getDoubleArray(index: Int): DoubleArray

Returns the output at index as a DoubleArray.

fun <ERROR CLASS>.getDoubleArray(name: String): DoubleArray

Returns the output by name as a DoubleArray.

getDoubleArrayWithShape
Link copied to clipboard
common
fun <ERROR CLASS>.getDoubleArrayWithShape(index: Int): <ERROR CLASS><DoubleArray, LongArray>

Returns the output at index as a DoubleArray with its shape.

fun <ERROR CLASS>.getDoubleArrayWithShape(name: String): <ERROR CLASS><DoubleArray, LongArray>

Returns the output by name as a DoubleArray with its shape.

getFloatArray
Link copied to clipboard
common
fun <ERROR CLASS>.getFloatArray(index: Int): FloatArray

Returns the output at index as a FloatArray.

fun <ERROR CLASS>.getFloatArray(name: String): FloatArray

Returns the output by name as a FloatArray.

getFloatArrayWithShape
Link copied to clipboard
common
fun <ERROR CLASS>.getFloatArrayWithShape(index: Int): <ERROR CLASS><FloatArray, LongArray>

Returns the output at index as a FloatArray with its shape.

fun <ERROR CLASS>.getFloatArrayWithShape(name: String): <ERROR CLASS><FloatArray, LongArray>

Returns the output by name as a FloatArray with its shape.

getIntArray
Link copied to clipboard
common
fun <ERROR CLASS>.getIntArray(index: Int): IntArray

Returns the output at index as an IntArray.

fun <ERROR CLASS>.getIntArray(name: String): IntArray

Returns the output by name as an IntArray.

getIntArrayWithShape
Link copied to clipboard
common
fun <ERROR CLASS>.getIntArrayWithShape(index: Int): <ERROR CLASS><IntArray, LongArray>

Returns the output at index as an IntArray with its shape.

fun <ERROR CLASS>.getIntArrayWithShape(name: String): <ERROR CLASS><IntArray, LongArray>

Returns the output by name as an IntArray with its shape.

getLongArray
Link copied to clipboard
common
fun <ERROR CLASS>.getLongArray(index: Int): LongArray

Returns the output at index as a LongArray.

fun <ERROR CLASS>.getLongArray(name: String): LongArray

Returns the output by name as a FloatArray.

getLongArrayWithShape
Link copied to clipboard
common
fun <ERROR CLASS>.getLongArrayWithShape(index: Int): <ERROR CLASS><LongArray, LongArray>

Returns the output at index as a LongArray with its shape.

fun <ERROR CLASS>.getLongArrayWithShape(name: String): <ERROR CLASS><LongArray, LongArray>

Returns the output by name as a LongArray with its shape.

getShortArray
Link copied to clipboard
common
fun <ERROR CLASS>.getShortArray(index: Int): ShortArray

Returns the output at index as a ShortArray.

fun <ERROR CLASS>.getShortArray(name: String): ShortArray

Returns the output by name as a ShortArray.

getShortArrayWithShape
Link copied to clipboard
common
fun <ERROR CLASS>.getShortArrayWithShape(index: Int): <ERROR CLASS><ShortArray, LongArray>

Returns the output at index as a ShortArray with its shape.

fun <ERROR CLASS>.getShortArrayWithShape(name: String): <ERROR CLASS><ShortArray, LongArray>

Returns the output by name as a ShortArray with its shape.

getValues
Link copied to clipboard
common
fun <ERROR CLASS>.getValues(): Map<String, Any>

Returns all values from this OrtSession.Result. This operation could be slow for high dimensional tensors, in which case functions that return one dimensional array such as getFloatArray or getLongArray should be used.