Skip to main content

ClikaRT::nn::fused

namespace

Functions​

fuse_linears()​

std::shared_ptr<Linear> fuse_linears(
    ClikaRT::Span<const std::shared_ptr<Linear>> parts,
    LinearOptions options = {}
)

Declared in ClikaRT/nn/fused.h, line 64

ClikaRT/nn/fused.h​

#include <ClikaRT/nn/fused.h>

ClikaRT::nn::fused::fuse_linears: sibling Linear projections (a QKV group, a gate‖up pair) collapse into ONE Linear that serves the concatenated projection. The parts keep their names, their weights and their biases: each consumed part still lists its weight, read back from the group's pack as its own row band, and its bias, read back as its band of the group's bias, so a fused model's named_parameters() / state_dict() stay total under the parts' own names while the group owns the subset's single resident copy. The parts' raw weights and biases release inside the fuse itself, no forward needed: the group is the one resident copy from the moment fuse_linears returns.