class_docstr: Samples according to the underlying instance of ``Sampler``, but splits
  the index sequences into smaller chunks.
  
  Used to split large logical batches into physical batches of a smaller size,
  while coordinating with DPOptimizer when the logical batch has ended.
docstr: Args:
      sampler: Wrapped Sampler instance
      max_batch_size: Max size of emitted chunk of indices
      optimizer: optimizer instance to notify when the logical batch is over
docstr_tok: ["Args",":","sampler",":","Wrapped","Sampler","instance","max_batch_size",":","Max","size","of","emitted","chunk","of","indices","optimizer",":","optimizer","instance","to","notify","when","the","logical","batch","is","over"]
code: def __init__(
      self,
      *,
      sampler: Sampler[List[int]],
      max_batch_size: int,
      optimizer: DPOptimizer,
  ):
      """
  
      Args:
          sampler: Wrapped Sampler instance
          max_batch_size: Max size of emitted chunk of indices
          optimizer: optimizer instance to notify when the logical batch is over
      """
      self.sampler = sampler
      self.max_batch_size = max_batch_size
      self.optimizer = optimizer
  
file_path: opacus/opacus/utils/batch_memory_manager.py
imports: import math
  from typing import List
  import numpy
  from opacus.optimizers import DPOptimizer
  from opacus.utils.uniform_sampler import DistributedUniformWithReplacementSampler, UniformWithReplacementSampler
  from torch.utils.data import BatchSampler, DataLoader, Sampler
label_desc: Use image node_id 1 to create a new BatchSplittingSampler object from inherited base classes: Sampler with example: obj = BatchSplittingSampler()