class_docstr: ConcatDataset of only TensorDatasets which supports getting slices.
  
  This dataset allows the use of slices, e.g. ds[2:4] if all concatenated
  datasets are either TensorDatasets or Subset or other ConcatTensorDataset instances
  which eventually contain only TensorDataset instances. If no slicing is needed,
  this class works exactly like torch.utils.data.ConcatDataset and can concatenate arbitrary
  (not just TensorDataset) datasets.
  
  Args:
      datasets (sequence): List of datasets to be concatenated
class_docstr_tok: ["ConcatDataset","of","only","TensorDatasets","which","supports","getting","slices",".","This","dataset","allows","the","use","of","slices",",","e.g",".","ds","[","2:4","]","if","all","concatenated","datasets","are","either","TensorDatasets","or","Subset","or","other","ConcatTensorDataset","instances","which","eventually","contain","only","TensorDataset","instances",".","If","no","slicing","is","needed",",","this","class","works","exactly","like","torch.utils.data.ConcatDataset","and","can","concatenate","arbitrary","(","not","just","TensorDataset",")","datasets",".","Args",":","datasets","(","sequence",")",":","List","of","datasets","to","be","concatenated"]
code: def __getitem__(self, idx):
      if isinstance(idx, slice):
          rows = [
              super(ConcatTensorDataset, self).__getitem__(i)
              for i in range(self.__len__())[idx]
          ]
          return tuple(map(torch.stack, zip(*rows)))
      elif isinstance(idx, (list, np.ndarray)):
          rows = [
              super(ConcatTensorDataset, self).__getitem__(i)
              for i in idx
          ]
          return tuple(map(torch.stack, zip(*rows)))
      else:
          return super(ConcatTensorDataset, self).__getitem__(idx)
  
file_path: FARM/farm/data_handler/dataset.py
imports: from typing import Iterable
  import numpy
  import numbers
  import logging
  import torch
  from torch.utils.data import Dataset, ConcatDataset, TensorDataset
  from farm.utils import flatten_list
label_desc: Use image node_id 2 for calling the ConcatTensorDataset obj's underlying member method code with example usage: obj.__getitem__(idx) and returns: tuple, tuple, super