# BatchSampler Source: https://www.tensorplay.cn/docs/generated/tensorplay.utils.data.BatchSampler.html ```python class tensorplay.utils.data.BatchSampler(sampler: Sampler[int] | Iterable[int], batch_size: int, drop_last: bool) ``` Wraps another sampler to yield a mini-batch of indices. Parameters: - sampler ([Sampler](/docs/generated/tensorplay.utils.data.Sampler.html#tensorplay.utils.data.Sampler) or Iterable) – Base sampler. Can be any iterable object - batch_size ([int](https://docs.python.org/3/builtins/functions.html#int)) – Size of mini-batch. - drop_last ([bool](https://docs.python.org/3/builtins/functions.html#bool)) – If True, the sampler will drop the last batch if its size would be less than batch_size