code: def testSparseRepeatedIndices(self):
      with ops.Graph().as_default():
          for dtype in [dtypes.half, dtypes.float32, dtypes.float64]:
              with self.cached_session():
                  repeated_index_update_var = variables.Variable(
                      [[1.0], [2.0]], dtype=dtype
                  )
                  aggregated_update_var = variables.Variable(
                      [[1.0], [2.0]], dtype=dtype
                  )
                  grad_repeated_index = indexed_slices.IndexedSlices(
                      constant_op.constant(
                          [0.1, 0.1], shape=[2, 1], dtype=dtype
                      ),
                      constant_op.constant([1, 1]),
                      constant_op.constant([2, 1]),
                  )
                  grad_aggregated = indexed_slices.IndexedSlices(
                      constant_op.constant(
                          [0.2], shape=[1, 1], dtype=dtype
                      ),
                      constant_op.constant([1]),
                      constant_op.constant([2, 1]),
                  )
                  repeated_update = adagrad.AdagradOptimizer(
                      3.0
                  ).apply_gradients(
                      [(grad_repeated_index, repeated_index_update_var)]
                  )
                  aggregated_update = adagrad.AdagradOptimizer(
                      3.0
                  ).apply_gradients(
                      [(grad_aggregated, aggregated_update_var)]
                  )
                  self.evaluate(
                      variables.global_variables_initializer()
                  )
                  self.assertAllClose(
                      aggregated_update_var,
                      self.evaluate(repeated_index_update_var),
                  )
                  for _ in range(3):
                      repeated_update.run()
                      aggregated_update.run()
                      self.assertAllClose(
                          aggregated_update_var,
                          self.evaluate(repeated_index_update_var),
                      )
  
imports: import numpy
  from tensorflow.python.eager import context
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import indexed_slices
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import embedding_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import resource_variable_ops
  from tensorflow.python.ops import variable_scope
  from tensorflow.python.ops import variables
  from tensorflow.python.platform import test
  from tensorflow.python.training import adagrad
label_desc: Use image node_id 9 for calling the AdagradOptimizerTest obj's underlying member method code with example usage: obj.testSparseRepeatedIndices() without return types