docstr: Logs a Precision-Recall Curve Data as an asset.
  
  Args:
  tag: An identifier for the PR curve
  summary: TensorboardX Summary protocol buffer.
  step: step value to record
docstr_tok: ["Logs","a","Precision-Recall","Curve","Data","as","an","asset",".","Args",":","tag",":","An","identifier","for","the","PR","curve","summary",":","TensorboardX","Summary","protocol","buffer",".","step",":","step","value","to","record"]
code: def log_pr_data(self, tag, summary, num_thresholds, step=None):
      """Logs a Precision-Recall Curve Data as an asset.
  
      Args:
      tag: An identifier for the PR curve
      summary: TensorboardX Summary protocol buffer.
      step: step value to record
      """
      tensor_proto = summary.value[0].tensor
      shape = [d.size for d in tensor_proto.tensor_shape.dim]
  
      values = np.fromiter(
          tensor_proto.float_val, dtype=np.float32
      ).reshape(shape)
      thresholds = [
          1.0 / num_thresholds * i for i in range(num_thresholds)
      ]
      tp, fp, tn, fn, precision, recall = map(
          lambda x: x.flatten().tolist(),
          np.vsplit(values, values.shape[0]),
      )
  
      pr_data = {
          "TP": tp,
          "FP": fp,
          "TN": tn,
          "FN": fn,
          "precision": precision,
          "recall": recall,
          "thresholds": thresholds,
          "name": tag,
      }
  
      self.log_asset_data(pr_data, name=tag, step=step)
  
imports: import logging
  import json
  import functools
  from io import BytesIO
  from google.protobuf.json_format import MessageToJson
  import numpy
  from .summary import _clean_tag
label_desc: Use image node_id 18 for calling the CometLogger obj's underlying member method code with example usage: obj.log_pr_data(tag, summary, num_thresholds, step) without return types