---
title: "ClikaRT::FakeTensor"
sidebar_label: "FakeTensor"
description: "A value type (no out-of-line surface): it holds a vector<spec::SymInt>, a dtype, a copyable Stream, and a flag, all ABI-stable, so it crosses by layout."
---

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

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

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

`FakeTensor`: a metadata-only tensor with a shape, a dtype, a placement, and a quantized flag, with NO storage and no data pointer. It is the descriptor a custom op's shape rule reads (its inputs) and returns (its outputs). Each dimension is a `spec::SymInt`, so a shape rule composes dimensions and declares data-dependent (bounded) extents exactly as the runtime does, and the same rule serves a concrete (eager) and a symbolic (traced) call. "Metadata only" is a type guarantee here: there is structurally no way to read element data.

A value type (no out-of-line surface): it holds a `vector<`[`spec::SymInt`](./spec/SymInt.md)`>`, a dtype, a copyable [`Stream`](./Stream.md), and a flag, all ABI-stable, so it crosses by layout.

## Member functions

### FakeTensor() {#FakeTensor}

<div class="api-signature">

**`FakeTensor`**(<br />
&nbsp;&nbsp;&nbsp;&nbsp;`std::vector<`[`spec::SymInt`](./spec/SymInt.md)`>` `shape`,<br />
&nbsp;&nbsp;&nbsp;&nbsp;[`DataType`](../index.md#DataType) `dtype`,<br />
&nbsp;&nbsp;&nbsp;&nbsp;[`StreamOrDevice`](./StreamOrDevice.md) `where` `=` `{}`,<br />
&nbsp;&nbsp;&nbsp;&nbsp;`bool` `is_quantized` `=` `false`<br />
)

</div>

`where` places the (output) tensor; pass an input's [`stream()`](./FakeTensor.md#stream) so the result lives alongside it (a bare device takes the calling thread's current lane on it; unspecified takes the ambient placement, else the current lane on the CPU). [`is_quantized`](./FakeTensor.md#is_quantized) marks the metadata as carrying a quantization scheme (the scheme itself is not modeled here).

<div class="api-declared">

Declared in `ClikaRT/compute/fake_tensor.h`, line 34

</div>

### shape() {#shape}

<div class="api-signature">

`const std::vector<`[`spec::SymInt`](./spec/SymInt.md)`>&` **`shape`**() `const noexcept`

</div>

the symbolic-or-concrete dims

<div class="api-declared">

Declared in `ClikaRT/compute/fake_tensor.h`, line 41

</div>

### dim() {#dim}

<div class="api-signature">

`const` [`spec::SymInt`](./spec/SymInt.md)`&` **`dim`**(`std::int64_t` `i`) `const`

</div>

one dim (no bounds check)

<div class="api-declared">

Declared in `ClikaRT/compute/fake_tensor.h`, line 42

</div>

### rank() {#rank}

<div class="api-signature">

`std::int64_t` **`rank`**() `const noexcept`

</div>

the dim count

<div class="api-declared">

Declared in `ClikaRT/compute/fake_tensor.h`, line 43

</div>

### numel() {#numel}

<div class="api-signature">

[`spec::SymInt`](./spec/SymInt.md) **`numel`**() `const`

</div>

The element count, the symbolic-aware product of the dimensions.

<div class="api-declared">

Declared in `ClikaRT/compute/fake_tensor.h`, line 46

</div>

### dtype() {#dtype}

<div class="api-signature">

[`DataType`](../index.md#DataType) **`dtype`**() `const noexcept`

</div>

the element dtype

<div class="api-declared">

Declared in `ClikaRT/compute/fake_tensor.h`, line 54

</div>

### stream() {#stream}

<div class="api-signature">

[`Stream`](./Stream.md) **`stream`**() `const`

</div>

the placement stream

<div class="api-declared">

Declared in `ClikaRT/compute/fake_tensor.h`, line 55

</div>

### device() {#device}

<div class="api-signature">

[`Device`](./Device.md) **`device`**() `const`

</div>

the placement device (the stream's)

<div class="api-declared">

Declared in `ClikaRT/compute/fake_tensor.h`, line 56

</div>

### is\_quantized() {#is_quantized}

<div class="api-signature">

`bool` **`is_quantized`**() `const noexcept`

</div>

whether the described tensor is quantized

<div class="api-declared">

Declared in `ClikaRT/compute/fake_tensor.h`, line 57

</div>
