class_docstr: The :class:`ImagingCallback` provides a generic interface for callbacks which yield images that should be sent to
  a file, tensorboard, visdom etc. without needing bespoke code. This allows the user to easily define custom
  visualisations by only writing the code to produce the image.
  
  Args:
      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.
class_docstr_tok: ["The",":","class",":","`","ImagingCallback","`","provides","a","generic","interface","for","callbacks","which","yield","images","that","should","be","sent","to","a","file",",","tensorboard",",","visdom","etc",".","without","needing","bespoke","code",".","This","allows","the","user","to","easily","define","custom","visualisations","by","only","writing","the","code","to","produce","the","image",".","Args",":","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","."]
docstr: Use `torchvision.utils.make_grid` to make a grid of the images being returned by this callback. Recommended
  for use alongside `cache`.
  
  Args:
      nrow: See `torchvision.utils.make_grid <https://pytorch.org/docs/stable/torchvision/utils.html#torchvision.utils.make_grid>`_
      padding: See `torchvision.utils.make_grid <https://pytorch.org/docs/stable/torchvision/utils.html#torchvision.utils.make_grid>`_
      normalize: See `torchvision.utils.make_grid <https://pytorch.org/docs/stable/torchvision/utils.html#torchvision.utils.make_grid>`_
      norm_range: See `torchvision.utils.make_grid <https://pytorch.org/docs/stable/torchvision/utils.html#torchvision.utils.make_grid>`_
      scale_each: See `torchvision.utils.make_grid <https://pytorch.org/docs/stable/torchvision/utils.html#torchvision.utils.make_grid>`_
      pad_value: See `torchvision.utils.make_grid <https://pytorch.org/docs/stable/torchvision/utils.html#torchvision.utils.make_grid>`_
  
  Returns:
      ImagingCallback: self
docstr_tok: ["Use","`","torchvision.utils.make_grid","`","to","make","a","grid","of","the","images","being","returned","by","this","callback",".","Recommended","for","use","alongside","`","cache","`",".","Args",":","nrow",":","See","`","torchvision.utils.make_grid","<","https",":","\/\/pytorch.org\/docs\/stable\/torchvision\/utils.html","#","torchvision.utils.make_grid",">","`","_","padding",":","See","`","torchvision.utils.make_grid","<","https",":","\/\/pytorch.org\/docs\/stable\/torchvision\/utils.html","#","torchvision.utils.make_grid",">","`","_","normalize",":","See","`","torchvision.utils.make_grid","<","https",":","\/\/pytorch.org\/docs\/stable\/torchvision\/utils.html","#","torchvision.utils.make_grid",">","`","_","norm_range",":","See","`","torchvision.utils.make_grid","<","https",":","\/\/pytorch.org\/docs\/stable\/torchvision\/utils.html","#","torchvision.utils.make_grid",">","`","_","scale_each",":","See","`","torchvision.utils.make_grid","<","https",":","\/\/pytorch.org\/docs\/stable\/torchvision\/utils.html","#","torchvision.utils.make_grid",">","`","_","pad_value",":","See","`","torchvision.utils.make_grid","<","https",":","\/\/pytorch.org\/docs\/stable\/torchvision\/utils.html","#","torchvision.utils.make_grid",">","`","_","Returns",":","ImagingCallback",":","self"]
code: def make_grid(
      self,
      nrow=8,
      padding=2,
      normalize=False,
      norm_range=None,
      scale_each=False,
      pad_value=0,
  ):
      """Use `torchvision.utils.make_grid` to make a grid of the images being returned by this callback. Recommended
      for use alongside `cache`.
  
      Args:
          nrow: See `torchvision.utils.make_grid <https://pytorch.org/docs/stable/torchvision/utils.html#torchvision.utils.make_grid>`_
          padding: See `torchvision.utils.make_grid <https://pytorch.org/docs/stable/torchvision/utils.html#torchvision.utils.make_grid>`_
          normalize: See `torchvision.utils.make_grid <https://pytorch.org/docs/stable/torchvision/utils.html#torchvision.utils.make_grid>`_
          norm_range: See `torchvision.utils.make_grid <https://pytorch.org/docs/stable/torchvision/utils.html#torchvision.utils.make_grid>`_
          scale_each: See `torchvision.utils.make_grid <https://pytorch.org/docs/stable/torchvision/utils.html#torchvision.utils.make_grid>`_
          pad_value: See `torchvision.utils.make_grid <https://pytorch.org/docs/stable/torchvision/utils.html#torchvision.utils.make_grid>`_
  
      Returns:
          ImagingCallback: self
      """
      import torchvision.utils as utils
  
      def decorator(func):
          def wrapper(state):
              cache = func(state)
              if cache is not None:
                  return utils.make_grid(
                      cache,
                      nrow=nrow,
                      padding=padding,
                      normalize=normalize,
                      range=norm_range,
                      scale_each=scale_each,
                      pad_value=pad_value,
                  )
  
          return wrapper
  
      self.on_batch = decorator(self.on_batch)
      return self
  
imports: import torchbearer
  from torchbearer import Callback
  import torch
label_desc: Use image node_id 14 for calling the ImagingCallback obj's underlying member method code with example usage: obj.make_grid(nrow, padding, normalize, norm_range, scale_each, pad_value) and returns: self, wrapper, utils