class_docstr: For each gradient tensor, summary its histogram and add it to moving
  summaries.
class_docstr_tok: ["For","each","gradient","tensor",",","summary","its","histogram","and","add","it","to","moving","summaries","."]
code: def _mapper(self, grad, var):
      name = var.op.name
      if re.match("tower[0-9]+/", name):
          # replicated training, var may come from different towers
          return grad
      if name not in SummaryGradient._summaried_gradient:
          SummaryGradient._summaried_gradient.add(name)
          tfv1.summary.histogram(
              name + "-grad", grad, collections=self._coll
          )
          add_moving_summary(rms(grad, name=name + "/rms"))
      return grad
  
imports: import inspect
  import re
  from abc import ABCMeta, abstractmethod
  import six
  import tensorflow
  from ..compat import tfv1
  from ..utils import logger
  from .summary import add_moving_summary
  from .symbolic_functions import print_stat, rms
label_desc: Use image node_id 2 for calling the SummaryGradient obj's underlying member method code with example usage: obj._mapper(grad, var) and returns: grad, grad