Package-level declarations

Types

Link copied to clipboard

Builder that records symbolic nodes/values. It is definition-only: no tensors are allocated.

Link copied to clipboard
annotation class DagDsl
Link copied to clipboard
abstract class DagModule

A reusable sub-graph module that can be instantiated within a DagBuilder.

Link copied to clipboard
Link copied to clipboard
data class GraphNodeDefinition(val id: String, val operation: Operation, val inputs: List<GraphValue<*>>, val outputs: List<GraphValue<*>>, val attributes: Map<String, Any?> = emptyMap())

Logical node definition captured by the DSL before lowering to sk.ainet.lang.graph.ComputeGraph.

Link copied to clipboard
data class GraphProgram(val nodes: List<GraphNodeDefinition>, val outputs: List<GraphValue<*>>)

Immutable program emitted by the DSL.

Link copied to clipboard
data class GraphValue<out T : DType>(val nodeId: String, val outputIndex: Int, val spec: TensorSpec)

Symbolic value flowing through the DAG DSL. Every value is produced by a node output.

Link copied to clipboard

Records a symbolic initializer hint (used only as metadata on TensorSpec).

Link copied to clipboard
class SymbolicTensorBuilder<T : DType>(dtype: KClass<T>, defaultName: String)

Lightweight, allocation-free builder that mimics the shape/initializer style of the data DSL but produces only TensorSpec metadata for the DAG DSL.

Functions

Link copied to clipboard
fun DagBuilder.abs(tensor: GraphValue<*>, id: String = ""): GraphValue<*>

DSL extension for abs.

Link copied to clipboard
fun DagBuilder.add(a: GraphValue<*>, b: GraphValue<*>, id: String = ""): GraphValue<*>

DSL extension for add.

Link copied to clipboard
fun DagBuilder.addScalar(a: GraphValue<*>, b: Number, id: String = ""): GraphValue<*>

DSL extension for addScalar.

Link copied to clipboard
fun DagBuilder.avgPool2d(input: GraphValue<*>, kernelSize: Pair<Int, Int>, stride: Pair<Int, Int> = 1 to 1, padding: Pair<Int, Int> = 0 to 0, countIncludePad: Boolean, id: String = ""): GraphValue<*>

DSL extension for avgPool2d.

Link copied to clipboard
fun DagBuilder.clamp(tensor: GraphValue<*>, minVal: Float, maxVal: Float, id: String = ""): GraphValue<*>

DSL extension for clamp.

Link copied to clipboard
fun DagBuilder.concat(tensors: List<GraphValue<*>>, dim: Int, id: String = ""): GraphValue<*>

DSL extension for concat.

Link copied to clipboard
fun DagBuilder.conv1d(input: GraphValue<*>, weight: GraphValue<*>, bias: GraphValue<*>, stride: Int, padding: Int, dilation: Int, groups: Int = 1, id: String = ""): GraphValue<*>

DSL extension for conv1d.

Link copied to clipboard
fun DagBuilder.conv2d(input: GraphValue<*>, weight: GraphValue<*>, bias: GraphValue<*>, stride: Pair<Int, Int> = 1 to 1, padding: Pair<Int, Int> = 0 to 0, dilation: Pair<Int, Int> = 1 to 1, groups: Int = 1, id: String = ""): GraphValue<*>

DSL extension for conv2d.

Link copied to clipboard
fun DagBuilder.conv3d(input: GraphValue<*>, weight: GraphValue<*>, bias: GraphValue<*>, stride: Triple<Int, Int, Int>, padding: Triple<Int, Int, Int>, dilation: Triple<Int, Int, Int>, groups: Int = 1, id: String = ""): GraphValue<*>

DSL extension for conv3d.

Link copied to clipboard
fun dag(block: DagBuilder.() -> Unit): GraphProgram

Entry point for the DAG DSL.

Link copied to clipboard

Defines a reusable graph component (module).

Link copied to clipboard
fun DagBuilder.divide(a: GraphValue<*>, b: GraphValue<*>, id: String = ""): GraphValue<*>

DSL extension for divide.

Link copied to clipboard
fun DagBuilder.divScalar(a: GraphValue<*>, b: Number, id: String = ""): GraphValue<*>

DSL extension for divScalar.

Link copied to clipboard
fun DagBuilder.elu(tensor: GraphValue<*>, alpha: Float, id: String = ""): GraphValue<*>

DSL extension for elu.

Link copied to clipboard
fun DagBuilder.flatten(tensor: GraphValue<*>, startDim: Int = 0, endDim: Int = -1, id: String = ""): GraphValue<*>

DSL extension for flatten.

Link copied to clipboard
fun DagBuilder.ge(tensor: GraphValue<*>, value: Float, id: String = ""): GraphValue<*>

DSL extension for ge.

Link copied to clipboard
fun DagBuilder.gelu(tensor: GraphValue<*>, id: String = ""): GraphValue<*>

DSL extension for gelu.

Link copied to clipboard
fun DagBuilder.leakyRelu(tensor: GraphValue<*>, negativeSlope: Float, id: String = ""): GraphValue<*>

DSL extension for leakyRelu.

Link copied to clipboard
fun DagBuilder.logSoftmax(tensor: GraphValue<*>, dim: Int = -1, id: String = ""): GraphValue<*>

DSL extension for logSoftmax.

Link copied to clipboard
fun DagBuilder.lt(tensor: GraphValue<*>, value: Float, id: String = ""): GraphValue<*>

DSL extension for lt.

Link copied to clipboard
fun DagBuilder.matmul(a: GraphValue<*>, b: GraphValue<*>, id: String = ""): GraphValue<*>

DSL extension for matmul.

Link copied to clipboard
fun DagBuilder.maxPool2d(input: GraphValue<*>, kernelSize: Pair<Int, Int>, stride: Pair<Int, Int> = 1 to 1, padding: Pair<Int, Int> = 0 to 0, id: String = ""): GraphValue<*>

DSL extension for maxPool2d.

Link copied to clipboard
fun DagBuilder.mean(tensor: GraphValue<*>, dim: Int = -1, id: String = ""): GraphValue<*>

DSL extension for mean.

Link copied to clipboard
fun DagBuilder.module(module: DagModule, inputs: List<GraphValue<*>>): List<GraphValue<*>>

DSL helper for using modules.

Link copied to clipboard
fun DagBuilder.mulScalar(a: GraphValue<*>, b: Number, id: String = ""): GraphValue<*>

DSL extension for mulScalar.

Link copied to clipboard
fun DagBuilder.multiply(a: GraphValue<*>, b: GraphValue<*>, id: String = ""): GraphValue<*>

DSL extension for multiply.

Link copied to clipboard
fun DagBuilder.narrow(tensor: GraphValue<*>, dim: Int, start: Int, length: Int, id: String = ""): GraphValue<*>

DSL extension for narrow.

Link copied to clipboard
fun DagBuilder.pad2d(tensor: GraphValue<*>, padLeft: Int, padRight: Int, padTop: Int, padBottom: Int, id: String = ""): GraphValue<*>

DSL extension for pad2d.

Link copied to clipboard

DSL extension for rdivScalar.

Link copied to clipboard
fun DagBuilder.relu(tensor: GraphValue<*>, id: String = ""): GraphValue<*>

DSL extension for relu.

Link copied to clipboard
fun DagBuilder.reshape(tensor: GraphValue<*>, newShape: Shape, id: String = ""): GraphValue<*>

DSL extension for reshape.

Link copied to clipboard

DSL extension for rsubScalar.

Link copied to clipboard
fun DagBuilder.sigmoid(tensor: GraphValue<*>, id: String = ""): GraphValue<*>

DSL extension for sigmoid.

Link copied to clipboard
fun DagBuilder.sign(tensor: GraphValue<*>, id: String = ""): GraphValue<*>

DSL extension for sign.

Link copied to clipboard
fun DagBuilder.silu(tensor: GraphValue<*>, id: String = ""): GraphValue<*>

DSL extension for silu.

Link copied to clipboard
fun DagBuilder.softmax(tensor: GraphValue<*>, dim: Int = -1, id: String = ""): GraphValue<*>

DSL extension for softmax.

Link copied to clipboard
fun DagBuilder.sqrt(tensor: GraphValue<*>, id: String = ""): GraphValue<*>

DSL extension for sqrt.

Link copied to clipboard
fun DagBuilder.squeeze(tensor: GraphValue<*>, dim: Int = -1, id: String = ""): GraphValue<*>

DSL extension for squeeze.

Link copied to clipboard
fun DagBuilder.subScalar(a: GraphValue<*>, b: Number, id: String = ""): GraphValue<*>

DSL extension for subScalar.

Link copied to clipboard
fun DagBuilder.subtract(a: GraphValue<*>, b: GraphValue<*>, id: String = ""): GraphValue<*>

DSL extension for subtract.

Link copied to clipboard
fun DagBuilder.sum(tensor: GraphValue<*>, dim: Int = -1, id: String = ""): GraphValue<*>

DSL extension for sum.

Link copied to clipboard
fun DagBuilder.transpose(tensor: GraphValue<*>, id: String = ""): GraphValue<*>

DSL extension for transpose.

Link copied to clipboard
fun DagBuilder.tril(tensor: GraphValue<*>, k: Int, id: String = ""): GraphValue<*>

DSL extension for tril.

Link copied to clipboard
fun DagBuilder.unfold(tensor: GraphValue<*>, dim: Int, size: Int, step: Int, id: String = ""): GraphValue<*>

DSL extension for unfold.

Link copied to clipboard
fun DagBuilder.unsqueeze(tensor: GraphValue<*>, dim: Int, id: String = ""): GraphValue<*>

DSL extension for unsqueeze.

Link copied to clipboard
fun DagBuilder.upsample2d(input: GraphValue<*>, scale: Pair<Int, Int>, mode: UpsampleMode = UpsampleMode.Nearest, alignCorners: Boolean = false, id: String = ""): GraphValue<*>

DSL extension for upsample2d.

Link copied to clipboard
fun DagBuilder.variance(tensor: GraphValue<*>, dim: Int = -1, id: String = ""): GraphValue<*>

DSL extension for variance.