CircularBuffer¶
- class torch_sim.properties.correlations.CircularBuffer(size, device=None)[source]¶
Bases:
object
Circular buffer for storing time series data.
Provides a fixed-size circular buffer optimized for storing and retrieving time series data, with minimal memory allocation.
- Variables:
size – Maximum number of elements to store
buffer – Storage for the data
head – Current write position
count – Number of elements currently stored
device – Device where the buffer is stored
- Parameters:
- append(value)[source]¶
Append a new value to the buffer.
- Parameters:
value (Tensor) – New tensor to store
- Return type:
None