Skip to main content

Buffer

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__​

__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.