Package org.jetbrains.kotlinx.dl.api.extension

Functions

argmax
Link copied to clipboard
fun FloatArray.argmax(): Int

Returns the index of the maximum element in the given FloatArray. TODO: Should be replaced with Multik in future.

convertTensorToFlattenFloatArray
Link copied to clipboard
fun Tensor<*>.convertTensorToFlattenFloatArray(): FloatArray

Copies tensor data to float array.

convertTensorToMultiDimArray
Link copied to clipboard
fun Tensor<*>.convertTensorToMultiDimArray(): Array<*>

Copies tensor to multidimensional float array. Array rank is equal to tensor rank.

get2D
Link copied to clipboard
fun FloatArray.get2D(rowIndex: Int, columnIndex: Int, width: Int): Float
get3D
Link copied to clipboard
fun FloatArray.get3D(rowIndex: Int, columnIndex: Int, channelIndex: Int, width: Int, channels: Int): Float
set2D
Link copied to clipboard
fun FloatArray.set2D(rowIndex: Int, columnIndex: Int, width: Int, value: Float)
set3D
Link copied to clipboard
fun FloatArray.set3D(rowIndex: Int, columnIndex: Int, channelIndex: Int, width: Int, channels: Int, value: Float)