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 the first element of each sample
  transformed by the transformer function `fn`.
  
  This is mostly applicable when each sample contains two components
  - features and label, i.e., (X, y), and you only want to transform
  the first element X (i.e., the features) while keeping the label y
  unchanged.
  
  Parameters
  ----------
  fn : callable
      A transformer function that takes the first element of a sample
      as input and returns the transformed element.
  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","the","first","element","of","each","sample","transformed","by","the","transformer","function","`","fn","`",".","This","is","mostly","applicable","when","each","sample","contains","two","components","-","features","and","label",",","i.e.",",","(","X",",","y",")",",","and","you","only","want","to","transform","the","first","element","X","(","i.e.",",","the","features",")","while","keeping","the","label","y","unchanged",".","Parameters","--","--","--","--","--","fn",":","callable","A","transformer","function","that","takes","the","first","element","of","a","sample","as","input","and","returns","the","transformed","element",".","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_first(self, fn, lazy=True):
      """Returns a new dataset with the first element of each sample
      transformed by the transformer function `fn`.
  
      This is mostly applicable when each sample contains two components
      - features and label, i.e., (X, y), and you only want to transform
      the first element X (i.e., the features) while keeping the label y
      unchanged.
  
      Parameters
      ----------
      fn : callable
          A transformer function that takes the first element of a sample
          as input and returns the transformed element.
      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.
      """
      return self.transform(_TransformFirstClosure(fn), lazy)
  
imports: import os
  from ...None import recordio, ndarray
  from ...util import default_array
label_desc: Use image node_id 8 for calling the Dataset obj's underlying member method code with example usage: obj.transform_first(fn, lazy) and returns: self