parameters: (self, indices)
return_statement: return indices
docstring: r"""Scatter method is used for splitting indices into subset, each subset
          will be assigned to a rank. Indices are evenly splitted by default.
          If customized indices assignment method is needed, please rewrite this method.
docstring_summary: r"""Scatter method is used for splitting indices into subset, each subset
          will be assigned to a rank. Indices are evenly splitted by default.
          If customized indices assignment method is needed, please rewrite this method.
docstring_tokens: r Scatter method is used for splitting indices into subset each subset will be assigned to a rank . Indices are evenly splitted by default . If customized indices assignment method is needed please rewrite this method .
function: def scatter(self, indices) -> List:
          r"""Scatter method is used for splitting indices into subset, each subset
          will be assigned to a rank. Indices are evenly splitted by default.
          If customized indices assignment method is needed, please rewrite this method.
          """
          total_size = self.num_samples * self.world_size
  
          # add extra indices to make it evenly divisible
          indices += indices[: (total_size - len(indices))]
          assert len(indices) == total_size
  
          # subsample
          indices = indices[self.rank : total_size : self.world_size]
          assert len(indices) == self.num_samples
  
          return indices
function_tokens: def scatter ( self , indices ) -> List : total_size = self . num_samples * self . world_size # add extra indices to make it evenly divisible indices += indices [ : ( total_size - len ( indices ) ) ] assert len ( indices ) == total_size # subsample indices = indices [ self . rank : total_size : self . world_size ] assert len ( indices ) == self . num_samples return indices