class_docstr: A layer receiving a tensor, and adding it to TensorBoard as an image.
  
  It takes an input and returns it unchanged. It stores this input as a state to
  be used as a metric in TensorBoard.
  It converts a tensor to a scalar by running a given aggregation function (mean
  by default). On TensorBoard, results for each device will be reported
  separately.
class_docstr_tok: ["A","layer","receiving","a","tensor",",","and","adding","it","to","TensorBoard","as","an","image",".","It","takes","an","input","and","returns","it","unchanged",".","It","stores","this","input","as","a","state","to","be","used","as","a","metric","in","TensorBoard",".","It","converts","a","tensor","to","a","scalar","by","running","a","given","aggregation","function","(","mean","by","default",")",".","On","TensorBoard",",","results","for","each","device","will","be","reported","separately","."]
docstr: Takes a tensor and returns it.
  
  Args:
    name: Name of the metric to be reported.
    n_in: Number of inputs.
    num_summaries: Number of images to show.
    recover_fn: the function for converting a tensor to a dipslayable image.
docstr_tok: ["Takes","a","tensor","and","returns","it",".","Args",":","name",":","Name","of","the","metric","to","be","reported",".","n_in",":","Number","of","inputs",".","num_summaries",":","Number","of","images","to","show",".","recover_fn",":","the","function","for","converting","a","tensor","to","a","dipslayable","image","."]
code: def __init__(self, name, n_in, num_summaries=5, recover_fn=None):
      """Takes a tensor and returns it.
  
      Args:
        name: Name of the metric to be reported.
        n_in: Number of inputs.
        num_summaries: Number of images to show.
        recover_fn: the function for converting a tensor to a dipslayable image.
      """
      super().__init__(name=f"Summary_{name}", n_in=n_in, n_out=n_in)
      name = "summary_" + name
      self._name = name
      self._num_summaries = num_summaries
      self._recover_fn = recover_fn
  
imports: from absl import logging
  import numpy
  import tensorflow
  from trax import fastmath
  from trax.fastmath import numpy
  from trax.layers import base
  from trax.layers import initializers
  from trax.layers.assert_shape import assert_shape
  from trax.layers.base import Fn
label_desc: Use image node_id 1 to create a new SummaryImage object from inherited base classes: base with example: obj = SummaryImage(name, n_in, num_summaries, recover_fn)