---
title: "ClikaRT::io::AdaptCompose"
sidebar_label: "AdaptCompose"
description: "N source parts produce ONE adapted entry under to, the value view."
---

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

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

**Header:** `ClikaRT/io/tensors_container.h`

N source parts produce ONE adapted entry under [`to`](./AdaptCompose.md#to), the value view. The parts are CONSUMED (their names leave the adapted key space); [`to`](./AdaptCompose.md#to) may equal one of the parts (the `weight` + `weight_scale` → `weight` shape).

[`transform`](./AdaptCompose.md#transform) runs LAZILY at materialization time (possibly mid `load_state_dict`), receiving the parts materialized per the container's load policy (already on the policy's device, unless [`host_parts`](./AdaptCompose.md#host_parts) places them on the host) and returning the produced tensor, which caches under [`to`](./AdaptCompose.md#to). It must be PURE over its inputs: capture no mutable state, never touch the container, and expect one invocation per materialization (an evicted composed value re-runs it on its next `get`). A throw from [`transform`](./AdaptCompose.md#transform) is contained at this boundary and surfaces as the materializing call's raised [`ClikaRT::Error`](../Error.md).

## Data members

### from {#from}

<div class="api-signature">

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

</div>

checkpoint-side names, concatenated in order

<div class="api-declared">

Declared in `ClikaRT/io/tensors_container.h`, line 271

</div>

### to {#to}

<div class="api-signature">

`std::string` **`to`**

</div>

the single composed output name

<div class="api-declared">

Declared in `ClikaRT/io/tensors_container.h`, line 272

</div>

### transform {#transform}

<div class="api-signature">

`std::function<`[`Result`](../Result.md)`<`[`Tensor`](../Tensor.md)`>(`[`ClikaRT::Span`](../Span.md)`<const` [`Tensor`](../Tensor.md)`>)>` **`transform`**

</div>

<div class="api-declared">

Declared in `ClikaRT/io/tensors_container.h`, line 273

</div>

### host\_parts {#host_parts}

<div class="api-signature">

`bool` **`host_parts`** `= false`

</div>

Materialize the parts on the HOST regardless of the load policy's device, for a transform that assembles bytes host-side (e.g. weaving a quantized blocks + scales pair into one packed payload). The raw parts then never upload (the assembly runs as plain host work instead of device ops), and the composed tensor caches as the transform returned it; a host-resident payload moves to its declared device when a module binds it, so the assembled bytes travel once. Affects parts placement only; leave unset to keep the policy placement.

<div class="api-declared">

Declared in `ClikaRT/io/tensors_container.h`, line 283

</div>
