class_docstr: 定制给 :class:`~fastNLP.core.dataloaders.MixDataLoader` 的 ``BatchSampler``，其功能是将传入的 ``datasets`` 
  字典混合采样组成一个个 batch 返回。
class_docstr_tok: ["\u5b9a\u5236\u7ed9",":","class",":","`","~fastNLP.core.dataloaders.MixDataLoader","`","\u7684","``","BatchSampler","``","\uff0c\u5176\u529f\u80fd\u662f\u5c06\u4f20\u5165\u7684","``","datasets","``","\u5b57\u5178\u6df7\u5408\u91c7\u6837\u7ec4\u6210\u4e00\u4e2a\u4e2a","batch","\u8fd4\u56de\u3002"]
code: def __len__(self) -> int:
      # 多卡情况下
      if self.rank >= 0 and self.word_size >= 0:
          # 整分给每个卡的数据
          self.len_samplers = (
              self.len_samplers - self.len_samplers % self.word_size
          ) / self.word_size
      if self.drop_last:
          return self.len_samplers // self.batch_size
      else:
          return (
              self.len_samplers + self.batch_size - 1
          ) // self.batch_size
  
imports: import array
  import numpy
  from typing import Union, List, Iterable, Dict
  from fastNLP.envs.imports import _NEED_IMPORT_TORCH
label_desc: Use image node_id 3 for calling the DopedSampler obj's underlying member method code with example usage: obj.__len__() and returns: unknown, unknown