SymbolicTensorBuilder

class SymbolicTensorBuilder<T : DType>(dtype: KClass<T>, defaultName: String)(source)

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

Constructors

Link copied to clipboard
constructor(dtype: KClass<T>, defaultName: String)

Functions

Link copied to clipboard
fun fromArray(values: FloatArray, shape: List<Int>? = null): TensorSpec

Infer shape from a flat float array. Stores initializer metadata only; no allocation is performed.

fun fromArray(values: IntArray, shape: List<Int>? = null): TensorSpec

Infer shape from a flat int array. Stores initializer metadata only; no allocation is performed.

Link copied to clipboard
fun shape(vararg dims: Int, init: SymbolicInit.() -> Unit = {}): TensorSpec

Declare a tensor with an explicit shape.

fun shape(dims: List<Int>, init: SymbolicInit.() -> Unit = {}): TensorSpec

Shape overload that accepts a list.