class_docstr: The :class:`FromState` callback is an :class:`ImagingCallback` which retrieves and image from state when called.
  The number of times the function is called can be controlled with a provided decorator (once_per_epoch, only_if
  etc.)
  
  Args:
      key (StateKey): The :class:`.StateKey` containing the image (tensor of size [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.
      decorator: A function which will be used to wrap the callback function. once_per_epoch by default
class_docstr_tok: ["The",":","class",":","`","FromState","`","callback","is","an",":","class",":","`","ImagingCallback","`","which","retrieves","and","image","from","state","when","called",".","The","number","of","times","the","function","is","called","can","be","controlled","with","a","provided","decorator","(","once_per_epoch",",","only_if","etc",".",")","Args",":","key","(","StateKey",")",":","The",":","class",":","`",".StateKey","`","containing","the","image","(","tensor","of","size","[","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",".","decorator",":","A","function","which","will","be","used","to","wrap","the","callback","function",".","once_per_epoch","by","default"]
code: def __init__(self, key, transform=None, decorator=None):
      super(FromState, self).__init__(transform=transform)
      self.key = key
  
      if decorator is not None:
          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 FromState object from inherited base classes: ImagingCallback with example: obj = FromState(key, transform, decorator)