def METHOD_NAME(predictions, targets, weights=None):
  return metrics.precision_at_thresholds(
      labels=targets,
      predictions=array_ops.slice(predictions, [0, 1], [-1, 1]),
      thresholds=np.arange(0, 1, 0.01, dtype=np.float32),
      weights=weights)