message: Making ids unique in nn.embedding_lookup_sparse. This helps to reduce RPC calls for looking up the embeddings when there are repeated ids in the batch.
diff: @@ -421,10 +421,7 @@ def embedding_lookup_sparse(params,
  segment_ids = math_ops.cast(segment_ids, dtypes.int32)
  ids = sp_ids.values
  - if ignore_weights:
  ids, idx = array_ops.unique(ids)
  - else:
  - idx = None
  embeddings = embedding_lookup(
  params, ids, partition_strategy=partition_strategy, max_norm=max_norm)
  @@ -433,6 +430,8 @@ def embedding_lookup_sparse(params,
  if weights.dtype != embeddings.dtype:
  weights = math_ops.cast(weights, embeddings.dtype)
  + embeddings = array_ops.gather(embeddings, idx)
  +
  # Reshape weights to allow broadcast
  ones = array_ops.fill(
  array_ops.expand_dims(array_ops.rank(embeddings) - 1, 0), 1)
  