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 的），因为 ``replica`` 和 ``pad`` 的原因，这个值可能等于、
  大于或者小于 ``len(dataset)``。
docstr_tok: ["\u5f53\u524d","sampler","\u4f1a\u6700\u7ec8\u4ea7\u751f\u51fa\u7684","index","\u6570\u91cf\uff08\u5305\u62ec\u4e86\u5176\u5b83","rank","\u7684\uff09\uff0c\u56e0\u4e3a","``","replica","``","\u548c","``","pad","``","\u7684\u539f\u56e0\uff0c\u8fd9\u4e2a\u503c\u53ef\u80fd\u7b49\u4e8e\u3001","\u5927\u4e8e\u6216\u8005\u5c0f\u4e8e","``","len","(","dataset",")","``","\u3002"]
code: def total_size(self):
      """
      当前 sampler 会最终产生出的 index 数量（包括了其它 rank 的），因为 ``replica`` 和 ``pad`` 的原因，这个值可能等于、
      大于或者小于 ``len(dataset)``。
      """
      return (
          self.num_consumed_samples
          + self.num_replicas * self.num_left_samples
      )
  
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 9 for calling the RandomSampler obj's underlying member method code with example usage: obj.total_size() and returns: unknown