class_docstr: An optimizer which accumulates gradients across :math:`k` :meth:`minimize` executions,
  and apply them together in every :math:`k` th :meth:`minimize` execution.
  This is roughly the same as using a :math:`k` times larger batch size plus a
  :math:`k` times larger learning rate, but uses much less memory.
  
  This optimizer can be used in any TensorFlow code (with or without tensorpack).
  
  Example:
  
  .. code-block:: python
  
      from tensorpack.tfutils.optimizer import AccumGradOptimizer
      myopt = tf.train.GradientDescentOptimizer(0.01)
      myopt = AccumGradOptimizer(myopt, niter=5)
      train_op = myopt.minimize(loss)
class_docstr_tok: ["An","optimizer","which","accumulates","gradients","across",":","math",":","`","k","`",":","meth",":","`","minimize","`","executions",",","and","apply","them","together","in","every",":","math",":","`","k","`","th",":","meth",":","`","minimize","`","execution",".","This","is","roughly","the","same","as","using","a",":","math",":","`","k","`","times","larger","batch","size","plus","a",":","math",":","`","k","`","times","larger","learning","rate",",","but","uses","much","less","memory",".","This","optimizer","can","be","used","in","any","TensorFlow","code","(","with","or","without","tensorpack",")",".","Example",":","..","code-block",":",":","python","from","tensorpack.tfutils.optimizer","import","AccumGradOptimizer","myopt","=","tf.train.GradientDescentOptimizer","(","0.01",")","myopt","=","AccumGradOptimizer","(","myopt",",","niter=5",")","train_op","=","myopt.minimize","(","loss",")"]
code: def _create_accum_slots(self, var_list):
      slots = []
      for v in var_list:
          # TODO an option to not colocate the accumulators with variables (to save more memory)
          s = self._zeros_slot(v, "accum", self._name)
          slots.append(s)
      return slots
  
imports: from contextlib import contextmanager
  import tensorflow
  from ..tfutils.common import get_tf_version_tuple
  from ..compat import tfv1
  from ..utils.develop import HIDE_DOC
  from .gradproc import FilterNoneGrad, GradientProcessor
label_desc: Use image node_id 2 for calling the AccumGradOptimizer obj's underlying member method code with example usage: obj._create_accum_slots(var_list) and returns: slots