Skip to main content

//clika-runtime/io.clika.runtime/CompileOptions

CompileOptions

[common]
data class CompileOptions(val inputShapes: Map<String, LongArray> = emptyMap(), val namedDims: Map<String, Long> = emptyMap(), val sampleInputs: Map<String, Tensor> = emptyMap(), val weights: Placement? = null, val stickyWeights: Boolean = false)

How OnnxModel.compile builds the graph. With none of the shape roads a dynamic input dim stays dynamic and the graph binds real shapes at run time; inputShapes pins an input to one fixed shape, namedDims pins every dim declared under that name (an ONNX dim_param), and sampleInputs pins each named input to its example's shape and dtype (the values are never read); the roads combine, the explicit shapes winning. weights is the device or stream the finalized graph serves on (null keeps the operators where they are); stickyWeights keeps the weights resident under memory pressure.

Constructors​

CompileOptions[common]
constructor(inputShapes: Map<String, LongArray> = emptyMap(), namedDims: Map<String, Long> = emptyMap(), sampleInputs: Map<String, Tensor> = emptyMap(), weights: Placement? = null, stickyWeights: Boolean = false)

Properties​

NameSummary
inputShapes[common]
val inputShapes: Map<String, LongArray>
namedDims[common]
val namedDims: Map<String, Long>
sampleInputs[common]
val sampleInputs: Map<String, Tensor>
stickyWeights[common]
val stickyWeights: Boolean = false
weights[common]
val weights: Placement? = null