class_docstr: 考虑在多卡 evaluate 的场景下，不能重复采样。
  
  :param dataset: 实现了 __len__ 方法的数据容器
  :param shuffle: 如果为 ``True``，将不进行 shuffle，实际上数据会以从长到短的方式输出
  :param seed: 设置的随机数种子
  :param kwargs: fastNLP 内部使用的参数
class_docstr_tok: ["\u8003\u8651\u5728\u591a\u5361","evaluate","\u7684\u573a\u666f\u4e0b\uff0c\u4e0d\u80fd\u91cd\u590d\u91c7\u6837\u3002",":","param","dataset",":","\u5b9e\u73b0\u4e86","__len__","\u65b9\u6cd5\u7684\u6570\u636e\u5bb9\u5668",":","param","shuffle",":","\u5982\u679c\u4e3a","``","True","``","\uff0c\u5c06\u4e0d\u8fdb\u884c","shuffle\uff0c\u5b9e\u9645\u4e0a\u6570\u636e\u4f1a\u4ee5\u4ece\u957f\u5230\u77ed\u7684\u65b9\u5f0f\u8f93\u51fa",":","param","seed",":","\u8bbe\u7f6e\u7684\u968f\u673a\u6570\u79cd\u5b50",":","param","kwargs",":","fastNLP","\u5185\u90e8\u4f7f\u7528\u7684\u53c2\u6570"]
docstr: 该方法本质上等同于 ddp 情形下的没有完成的初始化，应当在初始化该 Sampler 本身后立即被调用。
  
  :param num_replicas: 分布式训练中的进程总数
  :param rank: 当前进程的 ``global_rank``
  :return: 自身
docstr_tok: ["\u8be5\u65b9\u6cd5\u672c\u8d28\u4e0a\u7b49\u540c\u4e8e","ddp","\u60c5\u5f62\u4e0b\u7684\u6ca1\u6709\u5b8c\u6210\u7684\u521d\u59cb\u5316\uff0c\u5e94\u5f53\u5728\u521d\u59cb\u5316\u8be5","Sampler","\u672c\u8eab\u540e\u7acb\u5373\u88ab\u8c03\u7528\u3002",":","param","num_replicas",":","\u5206\u5e03\u5f0f\u8bad\u7ec3\u4e2d\u7684\u8fdb\u7a0b\u603b\u6570",":","param","rank",":","\u5f53\u524d\u8fdb\u7a0b\u7684","``","global_rank","``",":","return",":","\u81ea\u8eab"]
code: def set_distributed(self, num_replicas, rank):
      """
      该方法本质上等同于 ddp 情形下的没有完成的初始化，应当在初始化该 Sampler 本身后立即被调用。
  
      :param num_replicas: 分布式训练中的进程总数
      :param rank: 当前进程的 ``global_rank``
      :return: 自身
      """
      assert num_replicas <= self.num_samples, (
          f"The number of replicas({num_replicas}) should be lesser than the "
          f"number of samples({self.num_samples})."
      )
      assert num_replicas > 0 and isinstance(num_replicas, int)
      assert isinstance(rank, int) and 0 <= rank < num_replicas
      # 注意初始化该函数时，所有的状态都应当默认是一个 epoch 刚开始训练的状态；
      self.num_replicas = num_replicas
      self.rank = rank
  
      return self
  
imports: from typing import List, Union
  from fastNLP.core.dataset import DataSet
  import numpy
label_desc: Use image node_id 6 for calling the UnrepeatedRandomSampler obj's underlying member method code with example usage: obj.set_distributed(num_replicas, rank) and returns: self