class_docstr: Dump a tensor to image(s) to ``logger.get_logger_dir()`` once triggered.
  
  Note that it requires the tensor is directly evaluable, i.e. either inputs
  are not its dependency (e.g. the weights of the model), or the inputs are
  feedfree (in which case this callback will take an extra datapoint from the input pipeline).
class_docstr_tok: ["Dump","a","tensor","to","image","(","s",")","to","``","logger.get_logger_dir","(",")","``","once","triggered",".","Note","that","it","requires","the","tensor","is","directly","evaluable",",","i.e",".","either","inputs","are","not","its","dependency","(","e.g",".","the","weights","of","the","model",")",",","or","the","inputs","are","feedfree","(","in","which","case","this","callback","will","take","an","extra","datapoint","from","the","input","pipeline",")","."]
docstr: Args:
      tensor_name (str): the name of the tensor.
      prefix (str): the filename prefix for saved images. Defaults to the Op name.
      map_func: map the value of the tensor to an image or list of
           images of shape [h, w] or [h, w, c]. If None, will use identity.
      scale (float): a multiplier on pixel values, applied after map_func.
docstr_tok: ["Args",":","tensor_name","(","str",")",":","the","name","of","the","tensor",".","prefix","(","str",")",":","the","filename","prefix","for","saved","images",".","Defaults","to","the","Op","name",".","map_func",":","map","the","value","of","the","tensor","to","an","image","or","list","of","images","of","shape","[","h",",","w","]","or","[","h",",","w",",","c","]",".","If","None",",","will","use","identity",".","scale","(","float",")",":","a","multiplier","on","pixel","values",",","applied","after","map_func","."]
code: def __init__(
      self, tensor_name, prefix=None, map_func=None, scale=255
  ):
      """
      Args:
          tensor_name (str): the name of the tensor.
          prefix (str): the filename prefix for saved images. Defaults to the Op name.
          map_func: map the value of the tensor to an image or list of
               images of shape [h, w] or [h, w, c]. If None, will use identity.
          scale (float): a multiplier on pixel values, applied after map_func.
      """
      op_name, self.tensor_name = get_op_tensor_name(tensor_name)
      self.func = map_func
      if prefix is None:
          self.prefix = op_name
      else:
          self.prefix = prefix
      self.log_dir = logger.get_logger_dir()
      self.scale = scale
  
imports: import numpy
  import os
  from ..compat import tfv1
  from ..tfutils.common import get_op_tensor_name
  from ..utils import logger
  from .base import Callback
label_desc: Use image node_id 1 to create a new DumpTensorAsImage object from inherited base classes: Callback with example: obj = DumpTensorAsImage(tensor_name, prefix, map_func, scale)