class_docstr: 按照顺序读取 ``dataset`` 。在多卡情况下，间隔读取，例如，在两卡情况下，卡 0 取 ``[0,2,4,..]``, 卡 1 取 ``[1,3,5...]`` 。
  
  :param dataset: 实现了 __len__ 方法的数据容器。
  :param kwargs:
class_docstr_tok: ["\u6309\u7167\u987a\u5e8f\u8bfb\u53d6","``","dataset","``","\u3002\u5728\u591a\u5361\u60c5\u51b5\u4e0b\uff0c\u95f4\u9694\u8bfb\u53d6\uff0c\u4f8b\u5982\uff0c\u5728\u4e24\u5361\u60c5\u51b5\u4e0b\uff0c\u5361","0","\u53d6","``","[","0,2,4",",","..","]","``",",","\u5361","1","\u53d6","``","[","1,3,5","...","]","``","\u3002",":","param","dataset",":","\u5b9e\u73b0\u4e86","__len__","\u65b9\u6cd5\u7684\u6570\u636e\u5bb9\u5668\u3002",":","param","kwargs",":"]
code: def __iter__(self):
      if self.during_iter:  # 如果发现_during_iter为True，说明之前的还没结束，只有强制重新初始化了
          self.num_consumed_samples = 0
      self.during_iter = True
      indices = self.generate_indices()
  
      if self.pad:
          # add extra samples to make it evenly divisible
          padding_size = self.total_size - len(indices)
          if padding_size <= len(indices):
              indices += indices[:padding_size]
          else:
              indices += (
                  indices * math.ceil(padding_size / len(indices))
              )[:padding_size]
      else:
          # remove tail of data to make it evenly divisible.
          indices = indices[: self.total_size]
  
      assert len(indices) == self.total_size
  
      # subsample
      indices = indices[self.num_consumed_samples :]
      indices = indices[self.rank : len(indices) : self.num_replicas]
      assert len(indices) == self.num_left_samples
  
      for idx, index in enumerate(indices, start=1):
          self.num_consumed_samples += self.num_replicas
          yield index
      self.during_iter = False
      self.num_consumed_samples = 0
  
imports: from typing import Dict, List, Union, Sequence
  import math
  import numpy
  from fastNLP.core.log import logger
  from fastNLP.core.dataset import DataSet
label_desc: Use image node_id 2 for calling the SequentialSampler obj's underlying member method code with example usage: obj.__iter__() without return types