---
title: "Buffer"
sidebar_label: "Buffer"
description: "The clika_runtime.nn Buffer class."
---

<!-- Generated by tools/api_reference/generate_api_docs.py. Do not edit. -->

A tensor a module registers as a buffer: state that is not a learned weight (a mask, a precomputed table). Assigning one to a module attribute files it under that name; persistent=False keeps it out of state_dict(). Buffer(data) wraps `data` without copying.

## `data` (property)

The plain tensor handle behind this buffer (shared storage). Assigning rebinds the buffer to another tensor's storage in place.

## `persistent` (property)

Whether state_dict() includes this buffer.

## `__init__`

```python
__init____init__(self, data: clika_runtime._core.Tensor, *, persistent: bool = True) -> None
```

__init__(self, data: clika_runtime._core.Tensor, *, persistent: bool = True) -> None

Wrap `data` without copying; `persistent` says whether the buffer belongs in a state dict.
