class documentation

Class for iterating over the elements of an iterable with a dynamic batch size to achieve a desired target measurement.

The batch sizes emitted when iterating over this object are dynamically scaled such that the measurement between next() calls is as close as possible to a specified target.

Concrete base classes define the target measurement and method of calculation.

Method __init__ Undocumented
Instance Variable init_batch_size Undocumented
Instance Variable max_batch_beta Undocumented
Instance Variable max_batch_size Undocumented
Instance Variable min_batch_size Undocumented
Instance Variable target_measurement Undocumented
Method _compute_batch_size Return next batch size. Concrete classes must implement.
Method _get_measurement Get backpressure measurement for current batch.
Instance Variable _last_batch_size Undocumented

Inherited from Batcher:

Method __enter__ Undocumented
Method __exit__ Undocumented
Method __iter__ Undocumented
Method __next__ Undocumented
Method apply_backpressure Apply backpressure needed to rightsize the next batch.
Class Variable manual_backpressure Undocumented
Instance Variable iterable Undocumented
Instance Variable progress Undocumented
Instance Variable return_views Undocumented
Instance Variable total Undocumented
Instance Variable _in_context Undocumented
Instance Variable _iter Undocumented
Instance Variable _last_offset Undocumented
Instance Variable _manually_applied_backpressure Undocumented
Instance Variable _num_samples Undocumented
Instance Variable _pb Undocumented
Instance Variable _render_progress Undocumented
def __init__(self, iterable, target_measurement, init_batch_size=1, min_batch_size=1, max_batch_size=None, max_batch_beta=None, return_views=False, progress=False, total=None): (source)
target_measurement = (source)

Undocumented

def _compute_batch_size(self): (source)

Return next batch size. Concrete classes must implement.

@abc.abstractmethod
def _get_measurement(self): (source)

Get backpressure measurement for current batch.

_last_batch_size = (source)