---
title: "ClikaRT::spec"
sidebar_label: "spec"
description: "Namespace ClikaRT::spec"
---

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

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

## Classes

| Name | Description |
| --- | --- |
| [`Dim`](./Dim.md) | A dynamic dimension as a first-class object: declare it once, use it everywhere it appears, and every use refers to the SAME size. |
| [`DimOrInt`](./DimOrInt.md) | One entry of a shape given to `add_input` / `add_output`: a concrete extent, a bare dynamic marker, or a [`Dim`](./Dim.md) object. Implicit from both spellings, so a shape list mixes them freely: model.add\_input("x", DataType::Float32, \{batch, 128, -1\}); |
| [`DimOverride`](./DimOverride.md) | One dynamic dimension pinned by index; the static dims come from the model, so a spec only names what the model left open. [`min`](./DimOverride.md#min)/[`opt`](./DimOverride.md#opt)/[`max`](./DimOverride.md#max) follow [`ShapeProfile`](./ShapeProfile.md) semantics; the two-argument form pins a single value. |
| [`InputProfile`](./InputProfile.md) | One execution profile: a spec per input. An input the profile does not name resolves from the model itself (fully-static inputs need no entry; KV-cache inputs are derived from the detected cache structure). |
| [`InputSpec`](./InputSpec.md) | The spec for ONE input: identified by [`name`](./InputSpec.md#name) (preferred) or, when [`name`](./InputSpec.md#name) is empty, by [`position`](./InputSpec.md#position) in the model's input order, carrying either a full [`ShapeProfile`](./ShapeProfile.md) or a set of per-dim overrides (never both). |
| [`InputSpecs`](./InputSpecs.md) | The full input-shape specification: named-dim bindings + one or more per-input profiles. Every profile is validated against the model; profile 0's `opt` shapes are what the compiled graph is specialized to (additional profiles are recorded, not engine-selected; execution is eager, binding real shapes at run time). |
| [`KVSpecOptions`](./KVSpecOptions.md) | Options for `generate_kv_input_specs`: the batch size and past-sequence length every detected KV-cache input is specced at. The defaults describe a prefill step: a zero-length past. `past_len_*` follow [`ShapeProfile`](./ShapeProfile.md) min/opt/max semantics; set all three equal (or just construct with one value) for a fixed past length. |
| [`ShapeProfile`](./ShapeProfile.md) | The shape profile of ONE input: the range of shapes the compiled graph is prepared for, as three extent lists with one entry per dimension. [`min`](./ShapeProfile.md#min) is the smallest shape the input will be fed, [`max`](./ShapeProfile.md#max) the largest, and [`opt`](./ShapeProfile.md#opt) the typical one, which the compiled graph is specialized to; [`min`](./ShapeProfile.md#min)/[`max`](./ShapeProfile.md#max) are validated and recorded. For a fixed shape use the single-shape constructor (min == opt == max). |
| [`SymBool`](./SymBool.md) | A symbolic-or-concrete boolean, the result of comparing symbolic values (e.g. `a.lt(b)`). Logical composition (and/or/not) is not yet available. |
| [`SymFloat`](./SymFloat.md) | A symbolic-or-concrete float, e.g. an interpolation scale that derives a dimension. Arithmetic returns [`Result`](../Result.md) because it is fallible: a concrete pair folds immediately, while a symbolic operand is evaluated by the symbolic engine, which can report an error for an unsupported combination. |
| [`SymInt`](./SymInt.md) | A tensor dimension: a concrete size, or a symbolic value with inclusive `[lower, upper]` bounds. Compose with `+ - *` (bounds propagate) and [`floor_div`](./SymInt.md#floor_div); compare with `eq/ne/lt/le/gt/ge` → [`SymBool`](./SymBool.md). |
| [`TensorSpec`](./TensorSpec.md) | A named, typed input/output slot, the library's ONE vocabulary for describing a tensor slot (a model input/output, a graph feed, a traced signature). |

## `ClikaRT/compute/symbolic.h` {#symbolic-h}

```cpp
#include <ClikaRT/compute/symbolic.h>
```

Symbolic integer / float / bool values, the public projection of the runtime's symbolic algebra, for advanced shape rules. A `SymInt` is a tensor dimension that may be a concrete size or a symbolic value carrying inclusive `[lower, upper]` bounds; `SymFloat` and `SymBool` are its float and predicate siblings. Values compose (`a * b`, `dim.lt(n)`) and bounds propagate, exactly as they do inside the runtime, so one shape rule serves a concrete (eager) and a symbolic (traced) call alike.

## `ClikaRT/graph/input_specs.h` {#input_specs-h}

```cpp
#include <ClikaRT/graph/input_specs.h>
```

Input-shape specifications for building an executable `ModelGraph`: pin a model's dynamic input dimensions to concrete values (per input, by name or position; as a full min/opt/max shape profile or as per-dim overrides), and the `CompileOptions` set `io::OnnxModel::compile` consumes. The same specs drive `ClikaRT::trace`, which synthesizes tracing tensors from them.
