finalize

fun finalize(inputTensorIds: Set<String> = emptySet())(source)

Synthesize placeholder nodes for tensor inputs that had no known producer.

For each unresolved tensor:

  • If the tensor ID is in inputTensorIds, an "input" placeholder node is created (representing a function argument).

  • Else if the original tensor can be resolved from the session and contains constant data (e.g. model weights), a "weight" constant node is created.

  • Otherwise an "input" placeholder node is created as a fallback.

Edges are wired from the new nodes to every consumer that referenced the tensor. Call this after addAll when building graphs for compilation.

Parameters

inputTensorIds

Tensor IDs that should always become function arguments (model inputs).