trinity.buffer.buffer_reader module#

Reader of the buffer.

class trinity.buffer.buffer_reader.BufferReader[源代码]#

基类:ABC

Interface of the buffer reader.

abstractmethod read(batch_size: int | None = None, **kwargs) List[源代码]#

Read from buffer.

abstractmethod async read_async(batch_size: int | None = None, **kwargs) List[源代码]#

Read from buffer asynchronously.

state_dict() Dict[源代码]#

Return the state of the reader as a dict. :returns: A dict containing the reader state. At minimum, it should contain

the current_index field.

load_state_dict(state_dict: Dict) None[源代码]#