class_docstr: The :class:`CachingImagingCallback` is an :class:`ImagingCallback` which caches batches of images from the given
  state key up to the required amount before passing this along with state to the implementing class, once per epoch.
  
  Args:
      key (StateKey): The :class:`.StateKey` containing image data (tensor of size [b, c, w, h])
      transform (callable, optional): A function/transform that  takes in a Tensor and returns a transformed version.
          This will be applied to the image before it is sent to output.
      num_images: The number of images to cache
class_docstr_tok: ["The",":","class",":","`","CachingImagingCallback","`","is","an",":","class",":","`","ImagingCallback","`","which","caches","batches","of","images","from","the","given","state","key","up","to","the","required","amount","before","passing","this","along","with","state","to","the","implementing","class",",","once","per","epoch",".","Args",":","key","(","StateKey",")",":","The",":","class",":","`",".StateKey","`","containing","image","data","(","tensor","of","size","[","b",",","c",",","w",",","h","]",")","transform","(","callable",",","optional",")",":","A","function\/transform","that","takes","in","a","Tensor","and","returns","a","transformed","version",".","This","will","be","applied","to","the","image","before","it","is","sent","to","output",".","num_images",":","The","number","of","images","to","cache"]
code: def __init__(
      self, key=torchbearer.INPUT, transform=None, num_images=16
  ):
      super(CachingImagingCallback, self).__init__(
          key=key,
          transform=transform,
          decorator=_cache_images(num_images),
      )
  
      def decorator(func):
          def wrapper(state):
              res = func(state)
              if res is not None:
                  return self.on_cache(res, state)
  
          return wrapper
  
      self.on_batch = decorator(self.on_batch)
  
imports: import torchbearer
  from torchbearer import Callback
  import torch
label_desc: Use image node_id 1 to create a new CachingImagingCallback object from inherited base classes: FromState with example: obj = CachingImagingCallback(key, transform, num_images)