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 load_state_dict(self, states: Dict):
      # 如果 self.during_iter 是 True，那么 num_consumed_samples 一定是 0；
      assert self.during_iter is False, (
          "Cannot call load_state_dict() when it is "
          "during an unfinished iteration."
      )
  
      assert states["sampler_type"] == self.__class__.__name__, (
          f"The sampler type in checkpoint is {states['sampler_type']},"
          f"we cannot use {self.__class__.__name__} to load it."
      )
  
      length = states["length"]
      assert length == self.num_samples, (
          "The number of samples is different between the checkpoint "
          f"record({length}) and current dataset({self.num_samples})."
      )
      self.num_consumed_samples = states["num_consumed_samples"]
      if (
          self.num_consumed_samples >= length
      ):  # 如果保存的时候已经到达了最后一个sample了，则直接将结果重置为0
          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 5 for calling the SequentialSampler obj's underlying member method code with example usage: obj.load_state_dict(states) without return types