code: def _resource_apply_sparse(
      self, grad, var, indices, apply_state=None
  ):
      if "apply_state" in self._optimizer._sparse_apply_args:
          train_op = self._optimizer._resource_apply_sparse(
              grad, var, indices, apply_state=apply_state
          )
      else:
          train_op = self._optimizer._resource_apply_sparse(
              grad, var, indices
          )
      average_op = self._apply_average_op(train_op, var, apply_state)
      return tf.group(train_op, average_op)
  
imports: import abc
  import warnings
  import tensorflow
  from tensorflow_addons.optimizers import KerasLegacyOptimizer
  from tensorflow_addons.utils import types
  from typeguard import typechecked
label_desc: Use image node_id 9 for calling the AveragedOptimizerWrapper obj's underlying member method code with example usage: obj._resource_apply_sparse(grad, var, indices, apply_state) and returns: tf