code: def test_sparse_repeated_indices():
      for dtype in _dtypes_to_test(
          use_gpu=test_utils.is_gpu_available()
      ):
          repeated_index_update_var = tf.Variable(
              [[1.0], [2.0]], dtype=dtype
          )
          aggregated_update_var = tf.Variable(
              [[1.0], [2.0]], dtype=dtype
          )
          grad_repeated_index = tf.IndexedSlices(
              tf.constant([0.1, 0.1], shape=[2, 1], dtype=dtype),
              tf.constant([1, 1]),
              tf.constant([2, 1]),
          )
          grad_aggregated = tf.IndexedSlices(
              tf.constant([0.2], shape=[1, 1], dtype=dtype),
              tf.constant([1]),
              tf.constant([2, 1]),
          )
          opt1 = yogi.Yogi()
          opt2 = yogi.Yogi()
  
          np.testing.assert_allclose(
              aggregated_update_var.numpy(),
              repeated_index_update_var.numpy(),
          )
  
          for _ in range(3):
              opt1.apply_gradients(
                  [(grad_repeated_index, repeated_index_update_var)]
              )
              opt2.apply_gradients(
                  [(grad_aggregated, aggregated_update_var)]
              )
  
          np.testing.assert_allclose(
              aggregated_update_var.numpy(),
              repeated_index_update_var.numpy(),
          )
  
imports: import numpy
  import pytest
  import tensorflow
  from tensorflow_addons.optimizers import yogi
  from tensorflow_addons.utils import test_utils
label_desc: Use image node_id 9 for calling a global function with example usage: test_sparse_repeated_indices() without return types