---
title: "ClikaRT::QTensor"
sidebar_label: "QTensor"
description: "A quantized weight, viewed with its scheme. A value type over a refcounted payload handle; copying a QTensor never copies weight bytes."
---

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

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

**Header:** `ClikaRT/compute/q_tensor.h`

A quantized weight, viewed with its scheme. A value type over a refcounted payload handle; copying a [`QTensor`](./QTensor.md) never copies weight bytes.

## Data members

### payload {#payload}

<div class="api-signature">

[`Tensor`](./Tensor.md) **`payload`**

</div>

The packed payload exactly as loaded (for a GGUF block scheme: UInt8 `[rows, row_bytes]`, mmap-backed). The quantization metadata stays attached to the tensor itself (`payload.is_quantized()` is true).

<div class="api-declared">

Declared in `ClikaRT/compute/q_tensor.h`, line 72

</div>

### scheme {#scheme}

<div class="api-signature">

`std::string` **`scheme`**

</div>

The scheme's name, e.g. "GGUF\_Q8\_0", "GGUF\_Q4\_K".

<div class="api-declared">

Declared in `ClikaRT/compute/q_tensor.h`, line 74

</div>

### logical\_shape {#logical_shape}

<div class="api-signature">

`std::vector<std::int64_t>` **`logical_shape`**

</div>

The element shape the payload encodes. A GGUF matrix arrives as `[in_features, out_features]` (the row-contiguous dim first).

<div class="api-declared">

Declared in `ClikaRT/compute/q_tensor.h`, line 77

</div>

### global\_scale {#global_scale}

<div class="api-signature">

[`Tensor`](./Tensor.md) **`global_scale`**

</div>

The scheme's encode-time global scale when it carries one (NVFP4's alpha, the value the stored sub-scales were folded with; the consuming matmul applies the trailing ×(1/alpha)). Empty for every scheme without one. Rebuilding a payload through [`make_quantized`](../index.md#make_quantized) (e.g. after concatenating siblings) must pass this through, or the re-made weight silently serves un-descaled.

<div class="api-declared">

Declared in `ClikaRT/compute/q_tensor.h`, line 84

</div>
