code: def deduplicate_indexed_slices(indexed_slice: tf.IndexedSlices):
      """Sums `values` associated with any non-unique `indices`.
  
      Args:
        indexed_slice: An indexed slice with potentially duplicated indices.
  
      Returns:
        A tuple of (`summed_values`, `unique_indices`) where `unique_indices` is a
        de-duplicated version of `indices` and `summed_values` contains the sum of
        `values` slices associated with each unique index.
      """
      values, indices = indexed_slice.values, indexed_slice.indices
      unique_indices, new_index_positions = tf.unique(indices)
      summed_values = tf.math.unsorted_segment_sum(
          values, new_index_positions, tf.shape(unique_indices)[0]
      )
      return summed_values, unique_indices
  
imports: from typing import Sequence
  from sonnet.src import types
  from sonnet.src.distribute import replicator
  import tensorflow
label_desc: Use image node_id 4 for calling a global function with example usage: deduplicate_indexed_slices(indexed_slice) and returns: summed_values,  unique_indices