TensorDataFactory
Interface for tensor data factory used by the DSL
Inheritors
Functions
Link copied to clipboard
Link copied to clipboard
abstract fun <T : DType, V> fromFloatArray(shape: Shape, dtype: KClass<T>, data: FloatArray): TensorData<T, V>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun <T : DType, V> wrapByteArray(shape: Shape, dtype: KClass<T>, data: ByteArray): TensorData<T, V>
Wraps a ByteArray without copying. The caller must ensure the array is not mutated while the returned TensorData is in use. Default implementation falls back to fromByteArray (which copies).
Link copied to clipboard
open fun <T : DType, V> wrapFloatArray(shape: Shape, dtype: KClass<T>, data: FloatArray): TensorData<T, V>
Wraps a FloatArray without copying. The caller must ensure the array is not mutated while the returned TensorData is in use. Default implementation falls back to fromFloatArray (which copies).
Link copied to clipboard
open fun <T : DType, V> wrapIntArray(shape: Shape, dtype: KClass<T>, data: IntArray): TensorData<T, V>
Wraps an IntArray without copying. The caller must ensure the array is not mutated while the returned TensorData is in use. Default implementation falls back to fromIntArray (which copies).