from tensorflow.python.framework import ops

  Returns:
    precision: Scalar `float64` `Tensor` with the value of `true_positives`
      divided by the sum of `true_positives` and `false_positives`.
    update_op: `Operation` that increments `true_positives` and
      `false_positives` variables appropriately, and whose value matches
      `precision`.

  Raises:
    ValueError: If `ignore_mask` is not `None` and its shape doesn't match
      `predictions`, or if `weights` is not `None` and its shape doesn't match
      `predictions`, or if either `metrics_collections` or `updates_collections`
      are not a list or tuple.
  """
  default_name = _at_k_name('precision', k, class_id=class_id)
  with ops.name_scope(name, default_name,
                      (predictions, labels, ignore_mask, weights)) as scope:
    _, top_k_idx = nn.top_k(predictions, k)
    return _streaming_sparse_precision_at_k(
        top_k_idx=top_k_idx,
        labels=labels,
        k=k,
        class_id=class_id,
        ignore_mask=ignore_mask,
        weights=weights,
        metrics_collections=metrics_collections,
        updates_collections=updates_collections,
        name=scope)

