class_docstr: Wraps a python metric as a TF metric.
class_docstr_tok: ["Wraps","a","python","metric","as","a","TF","metric","."]
docstr: Creates a TF metric given a py metric to wrap.
  
  Args:
    py_metric: A batched python metric to wrap.
    name: Name of the metric.
    dtype: Data type of the metric.
docstr_tok: ["Creates","a","TF","metric","given","a","py","metric","to","wrap",".","Args",":","py_metric",":","A","batched","python","metric","to","wrap",".","name",":","Name","of","the","metric",".","dtype",":","Data","type","of","the","metric","."]
code: def __init__(self, py_metric, name=None, dtype=tf.float32):
      """Creates a TF metric given a py metric to wrap.
  
      Args:
        py_metric: A batched python metric to wrap.
        name: Name of the metric.
        dtype: Data type of the metric.
      """
      name = name or py_metric.name
      super(TFPyMetric, self).__init__(
          name=name, prefix=py_metric.prefix
      )
      self._py_metric = py_metric
      self._dtype = dtype
      self._lock = threading.Lock()
  
file_path: agents/tf_agents/metrics/tf_py_metric.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import contextlib
  import threading
  import tensorflow
  from tf_agents.metrics import tf_metric
label_desc: Use image node_id 1 to create a new TFPyMetric object from inherited base classes: tf_metric with example: obj = TFPyMetric(py_metric, name, dtype)