---
title: "ClikaRT::graph::CaptureOptions"
sidebar_label: "CaptureOptions"
description: "How ClikaRT::compile captures. The zero-options default runs the standard graph-optimization pipeline and finalizes packed weights, with shape specialization gated behind specialize (the shape guard a…"
---

<!-- Generated by tools/doxygen2mdx from Doxygen XML. Do not edit. -->

<span class="api-kind api-kind--struct">struct</span>

**Header:** `ClikaRT/graph/compile.h`

How `ClikaRT::compile` captures. The zero-options default runs the standard graph-optimization pipeline and finalizes packed weights, with shape specialization gated behind [`specialize`](./CaptureOptions.md#specialize) (the shape guard and the re-capture loop keep an unspecialized capture honest across shapes).

Scope: transform selection is not part of this surface; individual pass names are not public vocabulary; the capture runs the standard pipeline as one unit. A field value the captured road cannot honor is refused at [`compile()`](./index.md#compile) with a readable error, never ignored.

## Data members

### optimize {#optimize}

<div class="api-signature">

`bool` **`optimize`** `= true`

</div>

Run the graph optimizer on each capture ([`ModelGraph::optimize`](./ModelGraph.md#optimize)). `false` skips it: the graph replays exactly the operations the function recorded, the raw-topology posture for graph-level tooling and diagnosis. The capture is finalized either way, since a graph serves only once finalized.

<div class="api-declared">

Declared in `ClikaRT/graph/compile.h`, line 118

</div>

### specialize {#specialize}

<div class="api-signature">

`bool` **`specialize`** `= false`

</div>

Additionally collapse always-constant subgraphs and fix signature-static dims into the captured graph. Requires [`optimize`](./CaptureOptions.md#optimize) (specialization is a transform). Composes with the dynamic-dim hints: specialization fixes ONLY dims not declared dynamic; a hinted axis stays symbolic while everything else fixes, and a call that drifts on a fixed dim re-captures and re-fixes at the widened signature.

<div class="api-declared">

Declared in `ClikaRT/graph/compile.h`, line 125

</div>

### weights {#weights}

<div class="api-signature">

[`io::LoadPolicy`](../io/LoadPolicy.md) **`weights`**

</div>

Weight residency for the captured graph. [`device`](../device-namespace/index.md) anchors the EXECUTION lane the capture homes the graph onto; its packed weights build there and every replay runs there. Unset: the graph stays where the capture built it. The captured graph computes through the function's own operators, so homing it moves the weights of a module the function calls, and the module computes on that device afterwards. `sticky` is checkpoint-spill vocabulary with no captured-road meaning and is refused at [`compile()`](./index.md#compile).

<div class="api-declared">

Declared in `ClikaRT/graph/compile.h`, line 134

</div>

### dynamic\_dims {#dynamic_dims}

<div class="api-signature">

`std::vector<std::string>` **`dynamic_dims`**

</div>

Dimension NAMES declared dynamic: every signature axis carrying one of these names ([`spec::TensorSpec::dim_names`](../spec/TensorSpec.md#dim_names)) captures as a dynamic axis. A name matching no declared axis fails the capture (it would silently do nothing); the function then serves eagerly.

<div class="api-declared">

Declared in `ClikaRT/graph/compile.h`, line 139

</div>

### dynamic\_axes {#dynamic_axes}

<div class="api-signature">

`std::vector<`[`DynamicAxis`](./DynamicAxis.md)`>` **`dynamic_axes`**

</div>

Axes declared dynamic by coordinate, the road when the signature is derived from the first call (derived specs carry no dim names).

<div class="api-declared">

Declared in `ClikaRT/graph/compile.h`, line 142

</div>

### output\_names {#output_names}

<div class="api-signature">

`std::vector<std::string>` **`output_names`**

</div>

Names for the captured graph's outputs, positionally over the function's RETURNED outputs (empty = the "output\_0", "output\_1", … defaults; an empty entry keeps its positional default). State outputs the capture surfaces beyond the function's returns keep the names the capture assigns. A count that does not match the function's returns surfaces at the first capture, warned once, and the function keeps serving eagerly.

<div class="api-declared">

Declared in `ClikaRT/graph/compile.h`, line 150

</div>

### graph\_name {#graph_name}

<div class="api-signature">

`std::string` **`graph_name`** `= "compiled_model"`

</div>

The captured graph's name (profiling, diagnostics).

<div class="api-declared">

Declared in `ClikaRT/graph/compile.h`, line 152

</div>
