nums.core.storage.utils module
-
class
nums.core.storage.utils.
Batch
(total_size, batch_size)[source] Bases:
object
Simple object for creating an object that can generate batches of sequential integers.
-
get_batches
(total_size, batch_size)[source] - Parameters
total_size – Total number of items to split into batches.
batch_size – Size of each batch.
- Returns
A list of 2-tuples. Each 2-tuple is a segment of indices corresponding to items of size batch_size. The size of the list is total_size / batch_size.
-