generate

suspend fun <D : DType, V> generate(model: Model<D, V, Tensor<D, V>, Tensor<D, V>>, sampleInput: Tensor<D, V>, functionName: String = "main"): StableHloModule(source)

Generate StableHLO from any Model and a sample input tensor.

Parameters

model

The model whose forward pass will be traced.

sampleInput

A tensor with the desired input shape/dtype (values don't matter).

functionName

The MLIR function name in the emitted module.