class_docstr: Maintain the moving average of summarized tensors in every step,
  by ops added to the collection.
  Note that it only **maintains** the moving averages by updating
  the relevant variables in the graph,
  the actual summary should be done in other callbacks.
  
  This callback is one of the :func:`DEFAULT_CALLBACKS()`.
class_docstr_tok: ["Maintain","the","moving","average","of","summarized","tensors","in","every","step",",","by","ops","added","to","the","collection",".","Note","that","it","only","*","*","maintains","*","*","the","moving","averages","by","updating","the","relevant","variables","in","the","graph",",","the","actual","summary","should","be","done","in","other","callbacks",".","This","callback","is","one","of","the",":","func",":","`","DEFAULT_CALLBACKS","(",")","`","."]
code: def _setup_graph(self):
      ops = [k.op for k in tf.get_collection(self._collection)]
      if self._train_op is None:
          logger.info(
              "[MovingAverageSummary] {} operations in collection '{}' "
              "will be run with session hooks.".format(
                  len(ops), self._collection
              )
          )
  
          self.ema_op = tf.group(
              *ops, name="maintain_moving_average_summary"
          )
          self._fetch = tf.train.SessionRunArgs(fetches=self.ema_op)
      else:
          if isinstance(self._train_op, tf.Tensor):
              self._train_op = self._train_op.op
          if not isinstance(self._train_op, tf.Operation):
              self._train_op = self.graph.get_operation_by_name(
                  self._train_op
              )
          self._train_op._add_control_inputs(ops)
          logger.info(
              "[MovingAverageSummary] {} operations in collection '{}'"
              " will be run together with operation '{}'.".format(
                  len(ops), self._collection, self._train_op.name
              )
          )
  
imports: import numpy
  from collections import deque
  from ..compat import tfv1
  from ..tfutils.common import get_op_tensor_name
  from ..utils import logger
  from ..utils.naming import MOVING_SUMMARY_OPS_KEY
  from .base import Callback
label_desc: Use image node_id 2 for calling the MovingAverageSummary obj's underlying member method code with example usage: obj._setup_graph() without return types