dag

fun dag(block: DagBuilder.() -> Unit): GraphProgram(source)

Entry point for the DAG DSL.

Use it to define complex architectures with arbitrary wiring, multi-output graphs, and reusable modules.

Usage:

val program = dag {
val x = input<FP32>("x", TensorSpec("x", listOf(1, 4), "FP32"))
val w = parameter<FP32, Float>("w") { shape(4, 4) { ones() } }
val mm = matmul(x, w)
val y = relu(mm)
output(y)
}

Return

A GraphProgram that can be compiled to a sk.ainet.lang.graph.ComputeGraph.

See also

for defining reusable graph components.