class_docstr: A generic data loader where the images are arranged in this way: ::
  
      root/dog/xxx.png
      root/dog/xxy.png
      root/dog/xxz.png
  
      root/cat/123.png
      root/cat/nsdf3.png
      root/cat/asd932_.png
  
  Args:
      root (string): Root directory path.
      transform (callable, optional): A function/transform that  takes in an PIL image
          and returns a transformed version. E.g, ``transforms.RandomCrop``
      target_transform (callable, optional): A function/transform that takes in the
          target and transforms it.
      loader (callable, optional): A function to load an image given its path.
  
   Attributes:
      classes (list): List of the class names.
      class_to_idx (dict): Dict with items (class_name, class_index).
      imgs (list): List of (image path, class_index) tuples
class_docstr_tok: ["A","generic","data","loader","where","the","images","are","arranged","in","this","way",":",":",":","root\/dog\/xxx.png","root\/dog\/xxy.png","root\/dog\/xxz.png","root\/cat\/123.png","root\/cat\/nsdf3.png","root\/cat\/asd932_.png","Args",":","root","(","string",")",":","Root","directory","path",".","transform","(","callable",",","optional",")",":","A","function\/transform","that","takes","in","an","PIL","image","and","returns","a","transformed","version",".","E.g",",","``","transforms.RandomCrop","``","target_transform","(","callable",",","optional",")",":","A","function\/transform","that","takes","in","the","target","and","transforms","it",".","loader","(","callable",",","optional",")",":","A","function","to","load","an","image","given","its","path",".","Attributes",":","classes","(","list",")",":","List","of","the","class","names",".","class_to_idx","(","dict",")",":","Dict","with","items","(","class_name",",","class_index",")",".","imgs","(","list",")",":","List","of","(","image","path",",","class_index",")","tuples"]
code: def __init__(
      self,
      root,
      transform=None,
      target_transform=None,
      loader=default_loader,
      label_mapping=None,
  ):
      super(ImageFolder, self).__init__(
          root,
          loader,
          IMG_EXTENSIONS,
          transform=transform,
          target_transform=target_transform,
          label_mapping=label_mapping,
      )
      self.imgs = self.samples
  
imports: import torch.utils.data
  from torch.utils.data import Dataset
  from torchvision import transforms
  from PIL import Image
  import os
  import os.path
  import sys
label_desc: Use image node_id 1 to create a new ImageFolder object from inherited base classes: DatasetFolder with example: obj = ImageFolder(root, transform, target_transform, loader, label_mapping)