class_docstr: Wrapper for batching metrics.
  
  This can be used to wrap any python metric that takes a single trajectory to
  produce a batched version of the metric that takes a batch of trajectories.
class_docstr_tok: ["Wrapper","for","batching","metrics",".","This","can","be","used","to","wrap","any","python","metric","that","takes","a","single","trajectory","to","produce","a","batched","version","of","the","metric","that","takes","a","batch","of","trajectories","."]
code: def build(self, batch_size: types.Int):
      self._metrics = [
          self._metric_class(**self._metric_args)
          for _ in range(batch_size)
      ]
      for metric in self._metrics:
          metric.reset()
      self._built = True
  
file_path: agents/tf_agents/metrics/batched_py_metric.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from typing import Any, Optional, Text
  import numpy
  from tf_agents.metrics import py_metric
  from tf_agents.trajectories import trajectory
  from tf_agents.typing import types
  from tf_agents.utils import nest_utils
label_desc: Use image node_id 2 for calling the BatchedPyMetric obj's underlying member method code with example usage: obj.build(batch_size) without return types