class_docstr: A sliceable version of :class:`chainer.datasets.TupleDataset`.
  
  Here is an example.
  
  >>> # omit keys
  >>> dataset = TupleDataset([0, 1, 2], [0, 1, 4])
  >>> dataset.keys  # (None, None)
  >>> dataset.slice[:, 0][:]  # [0, 1, 2]
  >>>
  >>> dataset_more = TupleDataset(dataset, [0, 1, 8])
  >>> dataset_more.keys  # (None, None, None)
  >>> dataset_more.slice[:, [1, 2]][:]  # [(0, 0), (1, 1), (4, 8)]
  >>>
  >>> # specify the name of a key
  >>> named_dataset = TupleDataset(('feat0', [0, 1, 2]), [0, 1, 4])
  >>> named_dataset.keys  # ('feat0', None)
  >>> # slice takes both key and index (or their mixture)
  >>> named_dataset.slice[:, ['feat0', 1]][:]  # [(0, 0), (1, 1), (2, 4)]
  
  Args:
      datasets: The underlying datasets.
          The following datasets are acceptable.
  
          * An inheritance of                 :class:~chainer.datasets.sliceable.SliceableDataset`.
          * A tuple of a name and a data array.                  The data array should be list or :class:`numpy.ndarray`.
          * A data array. In this case, the name of key is :obj:`None`.
code: def __init__(self, *datasets):
      if len(datasets) == 0:
          raise ValueError("At least one dataset is required")
      self._len = None
      self._keys = []
      self._datasets = []
      for dataset in datasets:
          if isinstance(dataset, SliceableDataset):
              self._datasets.append(dataset)
              for key_index, key in enumerate(_as_tuple(dataset.keys)):
                  self._keys.append(
                      (key, len(self._datasets) - 1, key_index)
                  )
          else:
              if isinstance(dataset, tuple):
                  key, dataset = dataset
              else:
                  key = None
              self._datasets.append(dataset)
              self._keys.append((key, len(self._datasets) - 1, None))
          if self._len is None:
              self._len = len(dataset)
          if not len(dataset) == self._len:
              raise ValueError(
                  "All datasets should have the same length"
              )
  
file_path: chainercv/chainercv/chainer_experimental/datasets/sliceable/tuple_dataset.py
imports: from collections import defaultdict
  import six
  from chainercv.chainer_experimental.datasets.sliceable.sliceable_dataset import _as_tuple
  from chainercv.chainer_experimental.datasets.sliceable import SliceableDataset
label_desc: Use image node_id 1 to create a new TupleDataset object from inherited base classes: SliceableDataset with example: obj = TupleDataset()