class_docstr: Dataset for chaining multiple :class:`IterableDataset` s.
  
  This class is useful to assemble different existing dataset streams. The
  chaining operation is done on-the-fly, so concatenating large-scale
  datasets with this class will be efficient.
  
  Args:
      datasets (iterable of IterableDataset): datasets to be chained together
class_docstr_tok: ["Dataset","for","chaining","multiple",":","class",":","`","IterableDataset","`","s.","This","class","is","useful","to","assemble","different","existing","dataset","streams",".","The","chaining","operation","is","done","on-the-fly",",","so","concatenating","large-scale","datasets","with","this","class","will","be","efficient",".","Args",":","datasets","(","iterable","of","IterableDataset",")",":","datasets","to","be","chained","together"]
code: def __len__(self):
      total = 0
      for d in self.datasets:
          assert isinstance(
              d, IterableDataset
          ), "ChainDataset only supports IterableDataset"
          total += len(d)  # type: ignore[arg-type]
      return total
  
imports: import bisect
  import itertools
  import math
  import warnings
  from typing import cast, Dict, Generic, Iterable, List, Optional, Sequence, Tuple, TypeVar, Union
  from torch import default_generator, randperm
  from ...None import Generator, Tensor
label_desc: Use image node_id 3 for calling the ChainDataset obj's underlying member method code with example usage: obj.__len__() and returns: total