toComputeGraph

fun ExecutionTape.toComputeGraph(synthesizeExternalInputs: Boolean = false, inputTensorIds: Set<String> = emptySet()): ComputeGraph(source)

Convert the tape to a compute graph.

Parameters

synthesizeExternalInputs

When true, placeholder "input" and "weight" constant nodes are created for tensor inputs that have no known producer in the trace. Required for StableHLO compilation where every operand must be wired through graph edges.

inputTensorIds

Tensor IDs that should always become function arguments (model inputs) rather than constants, even if their data is resolvable.