from tensorflow.python.framework import ops

      predictions_idx=top_k_idx, labels=labels, k=k, class_id=class_id,
      weights=weights)
  fp, fp_update = _streaming_sparse_false_positive_at_k(
      predictions_idx=top_k_idx, labels=labels, k=k, class_id=class_id,
      weights=weights)

  metric = math_ops.div(tp, math_ops.add(tp, fp), name=name)
  update = math_ops.div(
      tp_update, math_ops.add(tp_update, fp_update), name='update')
  if metrics_collections:
    ops.add_to_collections(metrics_collections, metric)
  if updates_collections:
    ops.add_to_collections(updates_collections, update)
  return metric, update


# TODO(ptucker): Validate range of values in labels?
@deprecated_args(IGNORE_MASK_DATE, IGNORE_MASK_INSTRUCTIONS, 'ignore_mask')
def streaming_sparse_precision_at_k(predictions,
                                    labels,
