DagBuilder

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

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
inline fun <T : DType, V> constant(name: String, noinline builder: SymbolicTensorBuilder<T>.() -> TensorSpec): GraphValue<T>

Constant helper that reuses a symbolic, allocation-free data DSL to declare shape/dtype.

fun <T : DType> constant(name: String, spec: TensorSpec): GraphValue<T>

Declare a constant placeholder (treated like an input node).

Link copied to clipboard
fun <T : DType> input(name: String, spec: TensorSpec = TensorSpec(name = name, shape = null, dtype = "unknown")): GraphValue<T>

Declare a graph input placeholder.

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

DSL helper for using modules.

Link copied to clipboard
fun op(operation: Operation, inputs: List<GraphValue<*>>, id: String = "", attributes: Map<String, Any?> = emptyMap()): List<GraphValue<*>>

Generic operation hook that lets callers wire custom Operation instances.

Link copied to clipboard
fun output(vararg values: GraphValue<*>)

Mark a value as a program output. If none are marked, the last node's outputs are used.

Link copied to clipboard
inline fun <T : DType, V> parameter(name: String, noinline builder: SymbolicTensorBuilder<T>.() -> TensorSpec): GraphValue<T>

Parameter helper that reuses a symbolic, allocation-free data DSL to declare shape/dtype.

fun <T : DType> parameter(name: String, spec: TensorSpec): GraphValue<T>

Declare a parameter/weight placeholder.