def __init__(self, size: int):
        """
        Args:
            size (int): the total number of data of the underlying dataset to sample from
        """
        self._size = size
        assert size > 0
        self._rank = comm.get_rank()
        self._world_size = comm.get_world_size()
        self._local_indices = self._get_local_indices(size, self._world_size, self._rank)

        Args:
            size (int): the total number of data of the underlying dataset to sample from
        
video_chat_with_MOSS/models/grit_src/third_party/CenterNet2/detectron2/data/samplers/distributed_sampler.py