Package-level declarations

Types

Link copied to clipboard
class DenseFloatArrayTensorData<T : DType>(initialShape: Shape, val buffer: FloatArray) : FloatArrayTensorData<T>
Link copied to clipboard
class DenseIntArrayTensorData<T : DType>(initialShape: Shape, val buffer: IntArray) : IntArrayTensorData<T>
Link copied to clipboard

Low level DenseTensorDataFactory factories.

Link copied to clipboard

Marker interface for tensor data backed by a contiguous FloatArray. Provides direct buffer access for performance-critical backends.

Link copied to clipboard

Marker interface for tensor data backed by a direct FloatBuffer. This enables zero-copy memory-mapped file access on the JVM.

Link copied to clipboard

Marker interface for tensor data backed by a contiguous IntArray.

Link copied to clipboard
interface ItemsAccessor<T>

A fundamental data structure interface that provides indexed access to elements.

Link copied to clipboard

Marker interface for tensor data backed by a MemorySegment. Backends can check for this interface to use MemorySegment-based SIMD operations (e.g. FloatVector.fromMemorySegment) instead of array-based ops.

Link copied to clipboard

Off-heap, 64-byte-aligned tensor data backed by a MemorySegment.

Link copied to clipboard
class MemorySegmentTensorDataFactory(arena: Arena = Arena.ofShared(), alignment: Long = 64) : TensorDataFactory, AutoCloseable

A TensorDataFactory that produces MemorySegmentTensorData tensors, keeping all data off-heap for SIMD-friendly access.

Link copied to clipboard
class MmapFloatTensorData<T : DType>(initialShape: Shape, buffer: ByteBuffer) : FloatBufferTensorData<T>

Memory-mapped tensor data implementation that provides zero-copy access to tensor data stored in files.

Link copied to clipboard

A handle to a memory-mapped file region that can provide tensor views.

Link copied to clipboard
class Q4_KBlockTensorData(initialShape: Shape, data: ByteArray) : Q4_KTensorData

Implementation of Q4_KTensorData backed by a packed byte array.

Link copied to clipboard

Tensor data interface for Q4_K quantized format.

Link copied to clipboard

Marker interface for Q4 quantized data backed by a MemorySegment. Enables DefaultCpuOpsJvm to dispatch to MemorySegment-based Q4 kernels.

Link copied to clipboard
class Q4MemorySegmentTensorData(initialShape: Shape, val segment: MemorySegment, val segmentByteOffset: Long = 0) : TensorData<DType, Byte> , Q4MemorySegmentMarker

Q4_0 quantized tensor data backed by a MemorySegment.

Link copied to clipboard
class Q8_0BlockTensorData(initialShape: Shape, data: ByteArray) : Q8_0TensorData

Implementation of Q8_0TensorData backed by a packed byte array.

Link copied to clipboard

Tensor data interface for Q8_0 quantized format.

Link copied to clipboard

Marker interface for Q8_0 quantized data backed by a MemorySegment. Enables DefaultCpuOpsJvm to dispatch to MemorySegment-based Q8 kernels.

Link copied to clipboard
class Q8MemorySegmentTensorData(initialShape: Shape, val segment: MemorySegment, val segmentByteOffset: Long = 0) : TensorData<DType, Byte> , Q8MemorySegmentMarker

Q8_0 quantized tensor data backed by a MemorySegment.

Link copied to clipboard
interface TensorData<T : DType, V> : ItemsAccessor<V>

The fundamental data structure for tensor operations in the SKaiNET framework.

Link copied to clipboard

Interface for tensor data factory used by the DSL

Link copied to clipboard

Global registry for tensor data factories, enabling factory management for different precision types.

Link copied to clipboard
class Ternary2BitTensorData(initialShape: Shape, data: ByteArray, val scale: Float = 1.0f) : TernaryTensorData

Ternary tensor data using 2-bit encoding compatible with TQ2_0 format.

Link copied to clipboard

Marker interface for tensor data containing ternary values {-1, 0, +1}.

Functions

Link copied to clipboard
fun <T : DType, V> TensorData<T, V>.pprint(): String
Link copied to clipboard

Dequantize Q4_K tensor data to a FloatArray. outputi = codei * scale + min

Dequantize Q8_0 tensor data to a FloatArray. outputi = codei * scale

Convert a ternary tensor to FP32 by applying the scale factor. outputi = ternaryValuei * scale