Skip to main content

ClikaRT::nn::LinearOptions

struct

Header: ClikaRT/nn/linear.h

Construction options: everything beyond the two feature counts. Every field is optional / defaulted; the defaults produce a plain packing Linear.

Data members

activation

std::optional<ops::Activation> activation

Fused activation epilogue applied by every forward.

Declared in ClikaRT/nn/linear.h, line 111

residency

How the bound weight lives at rest. Packed packs on the first forward as ever. Borrowed never packs a private copy of a DENSE weight: the weight slot (typically a table adopted via share_weight) stays the one resident copy and every forward serves off it directly. A Borrowed QUANTIZED weight additionally memoizes its runtime form ONCE when it fits the free-memory budget (the shared payload stays the enumerable reset source); over budget it serves per call, the memory-pressure fallback, logged. Auto decides at the pack point by the free-memory budget (kAutoPackMaxFreeFraction) for dense AND quantized weights alike; a quantized weight packs when its projected resident form fits (payload-sized for a dense-coded scheme; priced as the dense compute copy for a block stream), and a transposed block stream resolves to the Borrowed/memoized route. The quantized PIN classes (QLinearWoQ / QLinear) serve Packed only and refuse the other values.

Declared in ClikaRT/nn/linear.h, line 127

bias

bool bias = false

Declare form only (make(in, out, ...)): declare a bias slot for a later bind. The from-tensors overload reads bias presence off its own bias argument and ignores this field.

Declared in ClikaRT/nn/linear.h, line 131

device

std::optional<Device> device

Placement of the declared slots. Declare form: defaults to cpu. From-tensors form: defaults to the weight's own device; when set, the payloads move there at bind (the declared placement wins).

Declared in ClikaRT/nn/linear.h, line 135

dtype

std::optional<DataType> dtype

PIN a dtype: the slots declare at it and every bind casts the payload to it. Unset (the default), a slot ADOPTS the bound payload's dtype (never a cast at rest) and reads DataType::Undefined until bound.

Declared in ClikaRT/nn/linear.h, line 139

output_quant

std::optional<OutputQuant> output_quant

Static output quantization of the product; setting it makes the factory return a QLinear (the static-quant posture; see qlinear.h). It wins over the weight's own form: a quantized weight WITH output requant is precisely W8A8.

Declared in ClikaRT/nn/linear.h, line 144