find_batch_size#
- bayesflow.utils.find_batch_size(sample, memory_budget: str = 'auto', min: int = 4, max: int = 1024) int [source]#
Returns an estimation of an optimal batch size based on memory budget and sample memory footprint.
- Parameters:
sample – Any nested structure of tensors, representing a single sample.
memory_budget – The maximum available memory for a single batch.
min – The minimum batch size.
max – The maximum batch size.