---
title: "CompileOptions"
sidebar_label: "CompileOptions"
description: "Kotlin binding reference: CompileOptions."
---

<!-- Generated by tools/api_reference/generate_api_docs.py. Do not edit. -->

//[clika-runtime](../../../index.md)/[io.clika.runtime](../index.md)/[CompileOptions](index.md)

# CompileOptions

[common]\
data class [CompileOptions](index.md)(val inputShapes: [Map](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html)&lt;[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html)&gt; = emptyMap(), val namedDims: [Map](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html)&lt;[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)&gt; = emptyMap(), val sampleInputs: [Map](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html)&lt;[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), [Tensor](../Tensor/index.md)&gt; = emptyMap(), val weights: [Placement](../Placement/index.md)? = null, val stickyWeights: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false)

How [OnnxModel.compile](../OnnxModel/compile.md) 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](inputShapes.md) pins an input to one fixed shape, [namedDims](namedDims.md) pins every dim declared under that name (an ONNX `dim_param`), and [sampleInputs](sampleInputs.md) pins each named input to its example's shape and dtype (the values are never read); the roads combine, the explicit shapes winning. [weights](weights.md) is the device or stream the finalized graph serves on (null keeps the operators where they are); [stickyWeights](stickyWeights.md) keeps the weights resident under memory pressure.

## Constructors

| | |
|---|---|
| [CompileOptions](CompileOptions.md) | [common]<br>constructor(inputShapes: [Map](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html)&lt;[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html)&gt; = emptyMap(), namedDims: [Map](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html)&lt;[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)&gt; = emptyMap(), sampleInputs: [Map](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html)&lt;[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), [Tensor](../Tensor/index.md)&gt; = emptyMap(), weights: [Placement](../Placement/index.md)? = null, stickyWeights: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false) |

## Properties

| Name | Summary |
|---|---|
| [inputShapes](inputShapes.md) | [common]<br>val [inputShapes](inputShapes.md): [Map](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html)&lt;[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html)&gt; |
| [namedDims](namedDims.md) | [common]<br>val [namedDims](namedDims.md): [Map](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html)&lt;[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)&gt; |
| [sampleInputs](sampleInputs.md) | [common]<br>val [sampleInputs](sampleInputs.md): [Map](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html)&lt;[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), [Tensor](../Tensor/index.md)&gt; |
| [stickyWeights](stickyWeights.md) | [common]<br>val [stickyWeights](stickyWeights.md): [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false |
| [weights](weights.md) | [common]<br>val [weights](weights.md): [Placement](../Placement/index.md)? = null |