class_docstr: `LSUN <http://lsun.cs.princeton.edu>`_ dataset.
  
  Args:
      root (string): Root directory for the database files.
      classes (string or list): One of {'train', 'val', 'test'} or a list of
          categories to load. e.g. ['bedroom_train', 'church_train'].
      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.
class_docstr_tok: ["`","LSUN","<","http",":","\/\/lsun.cs.princeton.edu",">","`","_","dataset",".","Args",":","root","(","string",")",":","Root","directory","for","the","database","files",".","classes","(","string","or","list",")",":","One","of","{","'train","'",",","'val","'",",","'test","'","}","or","a","list","of","categories","to","load",".","e.g",".","[","'bedroom_train","'",",","'church_train","'","]",".","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","."]
code: def __init__(
      self, root, classes="train", transform=None, target_transform=None
  ):
      categories = [
          "bedroom",
          "bridge",
          "church_outdoor",
          "classroom",
          "conference_room",
          "dining_room",
          "kitchen",
          "living_room",
          "restaurant",
          "tower",
      ]
      dset_opts = ["train", "val", "test"]
      self.root = os.path.expanduser(root)
      self.transform = transform
      self.target_transform = target_transform
  
      if type(classes) == str and classes in dset_opts:
          if classes == "test":
              classes = [classes]
          else:
              classes = [c + "_" + classes for c in categories]
      elif type(classes) == list:
          for c in classes:
              c_short = c.split("_")
              c_short.pop(len(c_short) - 1)
              c_short = "_".join(c_short)
              if c_short not in categories:
                  raise (
                      ValueError(
                          "Unknown LSUN class: " + c_short + "."
                          "Options are: " + str(categories)
                      )
                  )
              c_short = c.split("_")
              c_short = c_short.pop(len(c_short) - 1)
              if c_short not in dset_opts:
                  raise (
                      ValueError(
                          "Unknown postfix: " + c_short + "."
                          "Options are: " + str(dset_opts)
                      )
                  )
      else:
          raise (ValueError("Unknown option for classes"))
      self.classes = classes
  
      # for each class, create an LSUNClassDataset
      self.dbs = []
      for c in self.classes:
          self.dbs.append(
              LSUNClass(
                  root=root + "/" + c + "_lmdb", transform=transform
              )
          )
  
      self.indices = []
      count = 0
      for db in self.dbs:
          count += len(db)
          self.indices.append(count)
  
      self.length = count
  
imports: from __future__ import absolute_import
  from __future__ import division
  import os
  import numpy
  import mxnet
  from mxnet import gluon
  from PIL import Image
  import sys
label_desc: Use image node_id 1 to create a new LSUN object from inherited base classes: gluon.data with example: obj = LSUN(root, classes, transform, target_transform)