class_docstr: Gradient accumulation utility.
  When used with a distribution strategy, the accumulator should be called in a
  replica context. Gradients will be accumulated locally on each replica and
  without synchronization. Users should then call ``.gradients``, scale the
  gradients if required, and pass the result to ``apply_gradients``.
docstr: Number of accumulated steps.
docstr_tok: ["Number","of","accumulated","steps","."]
code: def step(self):
      """Number of accumulated steps."""
      if self._accum_steps is None:
          self._accum_steps = tf.Variable(
              tf.constant(0, dtype=tf.int64),
              trainable=False,
              synchronization=tf.VariableSynchronization.ON_READ,
              aggregation=tf.VariableAggregation.ONLY_FIRST_REPLICA,
          )
  
      return self._accum_steps.value()
  
imports: import re
  from typing import Callable, List, Optional, Union
  import tensorflow
  from packaging import version
label_desc: Use image node_id 2 for calling the GradientAccumulator obj's underlying member method code with example usage: obj.step() and returns: self