class_docstr: Abstract dataset class. All datasets should have this interface.
  
  Subclasses need to override `__getitem__`, which returns the i-th
  element, and `__len__`, which returns the total number elements.
  
  .. note:: An mxnet or numpy array can be directly used as a dataset.
docstr: Returns a new dataset with each sample transformed by the
  transformer function `fn`.
  
  Parameters
  ----------
  fn : callable
      A transformer function that takes a sample as input and
      returns the transformed sample.
  lazy : bool, default True
      If False, transforms all samples at once. Otherwise,
      transforms each sample on demand. Note that if `fn`
      is stochastic, you must set lazy to True or you will
      get the same result on all epochs.
  
  Returns
  -------
  Dataset
      The transformed dataset.
docstr_tok: ["Returns","a","new","dataset","with","each","sample","transformed","by","the","transformer","function","`","fn","`",".","Parameters","--","--","--","--","--","fn",":","callable","A","transformer","function","that","takes","a","sample","as","input","and","returns","the","transformed","sample",".","lazy",":","bool",",","default","True","If","False",",","transforms","all","samples","at","once",".","Otherwise",",","transforms","each","sample","on","demand",".","Note","that","if","`","fn","`","is","stochastic",",","you","must","set","lazy","to","True","or","you","will","get","the","same","result","on","all","epochs",".","Returns","--","--","--","-","Dataset","The","transformed","dataset","."]
code: def transform(self, fn, lazy=True):
      """Returns a new dataset with each sample transformed by the
      transformer function `fn`.
  
      Parameters
      ----------
      fn : callable
          A transformer function that takes a sample as input and
          returns the transformed sample.
      lazy : bool, default True
          If False, transforms all samples at once. Otherwise,
          transforms each sample on demand. Note that if `fn`
          is stochastic, you must set lazy to True or you will
          get the same result on all epochs.
  
      Returns
      -------
      Dataset
          The transformed dataset.
      """
      trans = _LazyTransformDataset(self, fn)
      if lazy:
          return trans
      return SimpleDataset([i for i in trans])
  
imports: import os
  from ...None import recordio, ndarray
  from ...util import default_array
label_desc: Use image node_id 7 for calling the Dataset obj's underlying member method code with example usage: obj.transform(fn, lazy) and returns: SimpleDataset, trans