class_docstr: `STL10 <https://cs.stanford.edu/~acoates/stl10/>`_ Dataset.
  
  Args:
      root (string): Root directory of dataset where directory
          ``stl10_binary`` exists.
      split (string): One of {'train', 'test', 'unlabeled', 'train+unlabeled'}.
          Accordingly, dataset is selected.
      folds (int, optional): One of {0-9} or None.
          For training, loads one of the 10 pre-defined folds of 1k samples for the
          standard evaluation procedure. If no value is passed, loads the 5k samples.
      transform (callable, optional): A function/transform that takes in a 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.
      download (bool, optional): If true, downloads the dataset from the internet and
          puts it in root directory. If dataset is already downloaded, it is not
          downloaded again.
class_docstr_tok: ["`","STL10","<","https",":","\/\/cs.stanford.edu\/~acoates\/stl10\/",">","`","_","Dataset",".","Args",":","root","(","string",")",":","Root","directory","of","dataset","where","directory","``","stl10_binary","``","exists",".","split","(","string",")",":","One","of","{","'train","'",",","'test","'",",","'unlabeled","'",",","'train+unlabeled","'","}",".","Accordingly",",","dataset","is","selected",".","folds","(","int",",","optional",")",":","One","of","{","0-9","}","or","None",".","For","training",",","loads","one","of","the","10","pre-defined","folds","of","1k","samples","for","the","standard","evaluation","procedure",".","If","no","value","is","passed",",","loads","the","5k","samples",".","transform","(","callable",",","optional",")",":","A","function\/transform","that","takes","in","a","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",".","download","(","bool",",","optional",")",":","If","true",",","downloads","the","dataset","from","the","internet","and","puts","it","in","root","directory",".","If","dataset","is","already","downloaded",",","it","is","not","downloaded","again","."]
code: def __init__(
      self,
      root: str,
      split: str = "train",
      folds: Optional[int] = None,
      transform: Optional[Callable] = None,
      target_transform: Optional[Callable] = None,
      download: bool = False,
  ) -> None:
      super().__init__(
          root, transform=transform, target_transform=target_transform
      )
      self.split = verify_str_arg(split, "split", self.splits)
      self.folds = self._verify_folds(folds)
  
      if download:
          self.download()
      elif not self._check_integrity():
          raise RuntimeError(
              "Dataset not found or corrupted. You can use download=True to download it"
          )
  
      # now load the picked numpy arrays
      self.labels: Optional[np.ndarray]
      if self.split == "train":
          self.data, self.labels = self.__loadfile(
              self.train_list[0][0], self.train_list[1][0]
          )
          self.labels = cast(np.ndarray, self.labels)
          self.__load_folds(folds)
  
      elif self.split == "train+unlabeled":
          self.data, self.labels = self.__loadfile(
              self.train_list[0][0], self.train_list[1][0]
          )
          self.labels = cast(np.ndarray, self.labels)
          self.__load_folds(folds)
          unlabeled_data, _ = self.__loadfile(self.train_list[2][0])
          self.data = np.concatenate((self.data, unlabeled_data))
          self.labels = np.concatenate(
              (self.labels, np.asarray([-1] * unlabeled_data.shape[0]))
          )
  
      elif self.split == "unlabeled":
          self.data, _ = self.__loadfile(self.train_list[2][0])
          self.labels = np.asarray([-1] * self.data.shape[0])
      else:  # self.split == 'test':
          self.data, self.labels = self.__loadfile(
              self.test_list[0][0], self.test_list[1][0]
          )
  
      class_file = os.path.join(
          self.root, self.base_folder, self.class_names_file
      )
      if os.path.isfile(class_file):
          with open(class_file) as f:
              self.classes = f.read().splitlines()
  
file_path: vision/torchvision/datasets/stl10.py
imports: import os.path
  from typing import Any, Callable, cast, Optional, Tuple
  import numpy
  from PIL import Image
  from .utils import check_integrity, download_and_extract_archive, verify_str_arg
  from .vision import VisionDataset
label_desc: Use image node_id 1 to create a new STL10 object from inherited base classes: VisionDataset with example: obj = STL10(root, split, folds, transform, target_transform, download)