Skip to content

solvers_utils#

Includes utility functions for the solvers.

Functions:

  • get_batches

    Computes the number of batches and their sizes.

get_batches #

get_batches(num_sections: int, max_batch_size: int) -> tuple[list, NDArray]

Computes the number of batches and their sizes.

Parameters:

  • num_sections (int) –

    The total number of sections to divide.

  • max_batch_size (int) –

    The maximum size of each batch.

Returns:

  • batches_sizes ( list ) –

    The sizes of each batch.

  • batches_slices ( NDArray ) –

    The offsets of each batch.