message: Temporarily resolve adagrad issue by using sparse read.
diff: @@ -27,6 +27,7 @@ from tensorflow.python.keras.optimizer_v2 import optimizer_v2
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import init_ops
  from tensorflow.python.ops import math_ops
  +from tensorflow.python.ops import resource_variable_ops
  from tensorflow.python.ops import state_ops
  from tensorflow.python.util.tf_export import keras_export
  @@ -164,10 +165,13 @@ class Adagrad(optimizer_v2.OptimizerV2):
  or self._fallback_apply_state(var_device, var_dtype))
  acc = self.get_slot(var, 'accumulator')
  - acc_t = self._resource_scatter_add(acc, indices, math_ops.square(grad))
  - acc_t_slice = array_ops.gather(acc_t, indices, axis=coefficients['zero'])
  - var_update = self._resource_scatter_add(
  - var, indices, coefficients['neg_lr_t'] * grad /
  + with ops.control_dependencies([
  + resource_variable_ops.resource_scatter_add(acc.handle, indices,
  + math_ops.square(grad))
  + ]):
  + acc_t_slice = acc.sparse_read(indices)
  + var_update = resource_variable_ops.resource_scatter_add(
  + var.handle, indices, coefficients['neg_lr_t'] * grad /
  (math_ops.sqrt(acc_t_slice) + coefficients['epsilon']))
  return var_update
  