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: Direct images from this callback to tensorboard with the given parameters
  
  Args:
      name (str): The name of the image
      log_dir (str): The tensorboard log path for output
      comment (str): Descriptive comment to append to path
      index (int or list or None): if not None, only apply the handler on this index / list of indices
  
  Returns:
      ImagingCallback: self
docstr_tok: ["Direct","images","from","this","callback","to","tensorboard","with","the","given","parameters","Args",":","name","(","str",")",":","The","name","of","the","image","log_dir","(","str",")",":","The","tensorboard","log","path","for","output","comment","(","str",")",":","Descriptive","comment","to","append","to","path","index","(","int","or","list","or","None",")",":","if","not","None",",","only","apply","the","handler","on","this","index","\/","list","of","indices","Returns",":","ImagingCallback",":","self"]
code: def to_tensorboard(
      self,
      name="Image",
      log_dir="./logs",
      comment="torchbearer",
      index=None,
  ):
      """Direct images from this callback to tensorboard with the given parameters
  
      Args:
          name (str): The name of the image
          log_dir (str): The tensorboard log path for output
          comment (str): Descriptive comment to append to path
          index (int or list or None): if not None, only apply the handler on this index / list of indices
  
      Returns:
          ImagingCallback: self
      """
      return self.with_handler(
          _to_tensorboard(name=name, log_dir=log_dir, comment=comment),
          index=index,
      )
  
imports: import torchbearer
  from torchbearer import Callback
  import torch
label_desc: Use image node_id 11 for calling the ImagingCallback obj's underlying member method code with example usage: obj.to_tensorboard(name, log_dir, comment, index) and returns: self