to NDArray
Returns D1Array containing all elements.
Samples
import org.jetbrains.kotlinx.multik.api.*
import org.jetbrains.kotlinx.multik.ndarray.data.D2
import org.jetbrains.kotlinx.multik.ndarray.data.D3
import org.jetbrains.kotlinx.multik.ndarray.data.DN
import org.jetbrains.kotlinx.multik.ndarray.data.DataType
import kotlin.test.Test
fun main() {
//sampleStart
val list = listOf(1, 2, 3, 4)
val ndarray = list.toNDArray()
println(ndarray) // [1, 2, 3, 4]
//sampleEnd
}
Returns D2Array containing all elements.
Returns D3Array containing all elements.
inline fun <T : Number> List<List<List<List<T>>>>.toNDArray(): D4Array<T>
Content copied to clipboard
inline fun <T : Complex> List<List<List<List<T>>>>.toNDArray(): D4Array<T>
Content copied to clipboard
Returns D4Array containing all elements.
Returns an D2Array.