code: def transform(self, t):
      # grab one image from t, and bring it into host mem
      if isinstance(t, np.ndarray):
          a = t
      else:
          a = t.get()
  
      a = a[:, self.image_index]
  
      # hack to convert single channel image to 3 channel for later processing
      if self.outshape[0] is 1:
          nshape = (3, self.outshape[1], self.outshape[2])
          img2 = np.ndarray(nshape, dtype="uint8")
          a = a.reshape((self.outshape[1], self.outshape[2]))
          img2[0, :, :] = a
          img2[1, :, :] = a
          img2[2, :, :] = a
          a = img2
      else:
          # coming from DataLoader first dimensioned has been flattened
          a = a.reshape(self.outshape)
      # transpose from CHW to H W C
      a = a.transpose(1, 2, 0)
      # reorder color channel
      a = a[:, :, ::-1]
      # TODO: see if this can be removed.
      a = a.astype("uint8")
  
      from PIL import Image as PILImage
  
      img = PILImage.fromarray(a)
      img.save(self.filename())
  
      # return unmodified tensor
      return t
  
imports: from __future__ import division
  import numpy
  from neon import NervanaObject
label_desc: Use image node_id 2 for calling the DumpImage obj's underlying member method code with example usage: obj.transform(t) and returns: t