class_docstr: 随机顺序的 Sampler 。
  
  :param dataset: 实现了 __len__ 方法的数据容器
  :param shuffle: 是否在每次 iterate 的时候打乱顺序
  :param seed: 随机数种子
  :param kwargs: fastNLP 内部使用的参数
class_docstr_tok: ["\u968f\u673a\u987a\u5e8f\u7684","Sampler","\u3002",":","param","dataset",":","\u5b9e\u73b0\u4e86","__len__","\u65b9\u6cd5\u7684\u6570\u636e\u5bb9\u5668",":","param","shuffle",":","\u662f\u5426\u5728\u6bcf\u6b21","iterate","\u7684\u65f6\u5019\u6253\u4e71\u987a\u5e8f",":","param","seed",":","\u968f\u673a\u6570\u79cd\u5b50",":","param","kwargs",":","fastNLP","\u5185\u90e8\u4f7f\u7528\u7684\u53c2\u6570"]
docstr: 返回 sampler 一次完整的迭代过程会产生多少个index。多卡的情况下，只考虑当前rank。
docstr_tok: ["\u8fd4\u56de","sampler","\u4e00\u6b21\u5b8c\u6574\u7684\u8fed\u4ee3\u8fc7\u7a0b\u4f1a\u4ea7\u751f\u591a\u5c11\u4e2aindex\u3002\u591a\u5361\u7684\u60c5\u51b5\u4e0b\uff0c\u53ea\u8003\u8651\u5f53\u524drank\u3002"]
code: def __len__(self):
      """
      返回 sampler 一次完整的迭代过程会产生多少个index。多卡的情况下，只考虑当前rank。
      """
      return self.total_size // self.num_replicas
  
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 RandomSampler obj's underlying member method code with example usage: obj.__len__() and returns: unknown