BatchedMobViewSequence

Qualified name: algan.utils.mob\_utils.BatchedMobViewSequence

class BatchedMobViewSequence(mob, size)[source]

Bases: Sequence

Sequence of lazy views into a mob’s batch dimension.

Creating the views eagerly would recreate the Python object graph that batching is intended to avoid. A view is therefore cloned only when a caller indexes or iterates over that element, and is cached so repeated indexing has the same object identity as an ordinary list of mobs. The clone shares the packed mob’s timeline rows; only data_sub_inds differs.

Methods