Skip to main content

ClikaRT::spec

namespace

Classes

NameDescription
DimA dynamic dimension as a first-class object: declare it once, use it everywhere it appears, and every use refers to the SAME size.
DimOrIntOne entry of a shape given to add_input / add_output: a concrete extent, a bare dynamic marker, or a Dim object. Implicit from both spellings, so a shape list mixes them freely: model.add_input("x", DataType::Float32, {batch, 128, -1});
DimOverrideOne dynamic dimension pinned by index; the static dims come from the model, so a spec only names what the model left open. min/opt/max follow ShapeProfile semantics; the two-argument form pins a single value.
InputProfileOne 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).
InputSpecThe spec for ONE input: identified by name (preferred) or, when name is empty, by position in the model's input order, carrying either a full ShapeProfile or a set of per-dim overrides (never both).
InputSpecsThe 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).
KVSpecOptionsOptions 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 min/opt/max semantics; set all three equal (or just construct with one value) for a fixed past length.
ShapeProfileThe 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 is the smallest shape the input will be fed, max the largest, and opt the typical one, which the compiled graph is specialized to; min/max are validated and recorded. For a fixed shape use the single-shape constructor (min == opt == max).
SymBoolA symbolic-or-concrete boolean, the result of comparing symbolic values (e.g. a.lt(b)). Logical composition (and/or/not) is not yet available.
SymFloatA symbolic-or-concrete float, e.g. an interpolation scale that derives a dimension. Arithmetic returns Result 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.
SymIntA tensor dimension: a concrete size, or a symbolic value with inclusive [lower, upper] bounds. Compose with + - * (bounds propagate) and floor_div; compare with eq/ne/lt/le/gt/geSymBool.
TensorSpecA 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

#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

#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.