Package-level declarations

Types

Link copied to clipboard
class AddOperation<T : DType, V>(parameters: Map<String, Any> = emptyMap()) : BaseOperation

Basic math operations for graph-based execution

Link copied to clipboard
abstract class BaseOperation(val name: String, val type: String, val parameters: Map<String, Any> = emptyMap()) : Operation

Abstract base class for operations that provides common functionality

Link copied to clipboard
class Conv1dOperation<T : DType, V>(parameters: Map<String, Any> = emptyMap()) : BaseOperation

Convolutional operations

Link copied to clipboard
class Conv2dOperation<T : DType, V>(parameters: Map<String, Any> = emptyMap()) : BaseOperation
Link copied to clipboard
class Conv3dOperation<T : DType, V>(parameters: Map<String, Any> = emptyMap()) : BaseOperation
Link copied to clipboard

Single source of truth for convolution output-shape arithmetic.

Link copied to clipboard
class DivideOperation<T : DType, V>(parameters: Map<String, Any> = emptyMap()) : BaseOperation
Link copied to clipboard
class FlattenOperation<T : DType, V>(parameters: Map<String, Any> = emptyMap()) : BaseOperation
Link copied to clipboard
class GenericOperation(val name: String, val parameters: Map<String, Any> = emptyMap(), val type: String = "generic") : BaseOperation

A generic operation that can be used when a specialized operation class is not available.

Link copied to clipboard
class InputOperation<T : DType, V>(parameters: Map<String, Any> = emptyMap()) : BaseOperation

Input tensor operation for graph representation

Link copied to clipboard
class MatmulOperation<T : DType, V>(parameters: Map<String, Any> = emptyMap()) : BaseOperation

Linear algebra operations

Link copied to clipboard
class MaxPool2dOperation<T : DType, V>(parameters: Map<String, Any> = emptyMap()) : BaseOperation

Pooling operations

Link copied to clipboard
Link copied to clipboard
class MultiplyOperation<T : DType, V>(parameters: Map<String, Any> = emptyMap()) : BaseOperation
Link copied to clipboard
interface Operation

Interface for operations that can be represented as graph nodes. Each operation defines how to execute a computation and its metadata.

Link copied to clipboard

Optimized matrix multiplication for quantized weight formats (Q8_0, Q4_K).

Link copied to clipboard
class ReluOperation<T : DType, V>(parameters: Map<String, Any> = emptyMap()) : BaseOperation

Activation functions

Link copied to clipboard
class ReshapeOperation<T : DType, V>(parameters: Map<String, Any> = emptyMap()) : BaseOperation

Shape operations

Link copied to clipboard
class ScaledDotProductAttentionOperation(parameters: Map<String, Any> = emptyMap()) : BaseOperation

Scaled dot-product attention operation for tape recording. Output shape = query shape: batch, nHeads, seqLen, headDim

Link copied to clipboard
class SigmoidOperation<T : DType, V>(parameters: Map<String, Any> = emptyMap()) : BaseOperation
Link copied to clipboard
class SoftmaxOperation<T : DType, V>(parameters: Map<String, Any> = emptyMap()) : BaseOperation
Link copied to clipboard
class SqueezeOperation<T : DType, V>(parameters: Map<String, Any> = emptyMap()) : BaseOperation

Additional shape operations

Link copied to clipboard
class SubtractOperation<T : DType, V>(parameters: Map<String, Any> = emptyMap()) : BaseOperation
Link copied to clipboard
interface TensorOps
Link copied to clipboard
data class TensorSpec(val name: String, val shape: List<Int>?, val dtype: String, val requiresGrad: Boolean = false, val metadata: Map<String, Any> = emptyMap())

Specification for a tensor in the graph, containing shape and type information

Link copied to clipboard

Optimized matrix multiplication for BitNet-style ternary weights.

Link copied to clipboard
class TransposeOperation<T : DType, V>(parameters: Map<String, Any> = emptyMap()) : BaseOperation
Link copied to clipboard
class UnsqueezeOperation<T : DType, V>(parameters: Map<String, Any> = emptyMap()) : BaseOperation
Link copied to clipboard
class Upsample2dOperation<T : DType, V>(parameters: Map<String, Any> = emptyMap()) : BaseOperation
Link copied to clipboard

Interpolation modes for 2D upsampling.

Link copied to clipboard
sealed class ValidationResult

Result of graph validation

Link copied to clipboard

Properties

Link copied to clipboard

Metadata key used to carry a TensorEncoding on a TensorSpec.

Link copied to clipboard

Physical storage encoding carried on this spec, or null if the producer did not populate it.

Functions

Link copied to clipboard

Infer a TensorEncoding from a concrete TensorData instance, or return null when the layout is dense / unknown. Single source of truth for the data-subclass → encoding mapping so trace builders and loaders agree.

Link copied to clipboard

Extension function for Q4_K matmul.

Link copied to clipboard

Extension function for Q8_0 matmul.

Link copied to clipboard

Extension function for convenient ternary matmul. Use this when you know the weight is ternary-quantized.

Link copied to clipboard

Return a copy of this spec with encoding stored in its metadata map. Passing null removes the entry; passing a non-null value adds or replaces it, leaving all other metadata untouched.