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 Conv2dOperation<T : DType, V>(parameters: Map<String, Any> = emptyMap()) : BaseOperation

Convolutional operations

Link copied to clipboard

Contract for providing adjoint (backward) rules for differentiable operations. This interface is generated based on @Diff annotations in TensorOps.

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 KspTensorOps(base: TensorOps, sink: OpSink, session: TraceSession = TraceSession()) : TensorOps

Generated tracing wrapper for TensorOps. This class delegates all method calls to the base implementation while emitting OpTrace events to capture the computation graph.

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 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

Functions

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.