class_docstr: A replay buffer shard for multiagent setups.
  
  This buffer is meant to be run in parallel to distribute experiences
  across `num_shards` shards. Unlike simpler buffers, it holds a set of
  buffers - one for each policy ID.
docstr: Returns the stats of this buffer and all underlying buffers.
  
  Args:
      debug: If True, stats of underlying replay buffers will
      be fetched with debug=True.
  
  Returns:
      stat: Dictionary of buffer stats.
docstr_tok: ["Returns","the","stats","of","this","buffer","and","all","underlying","buffers",".","Args",":","debug",":","If","True",",","stats","of","underlying","replay","buffers","will","be","fetched","with","debug=True",".","Returns",":","stat",":","Dictionary","of","buffer","stats","."]
code: def stats(self, debug: bool = False) -> Dict:
      """Returns the stats of this buffer and all underlying buffers.
  
      Args:
          debug: If True, stats of underlying replay buffers will
          be fetched with debug=True.
  
      Returns:
          stat: Dictionary of buffer stats.
      """
      stat = {
          "add_batch_time_ms": round(
              1000 * self.add_batch_timer.mean, 3
          ),
          "replay_time_ms": round(1000 * self.replay_timer.mean, 3),
      }
      for policy_id, replay_buffer in self.replay_buffers.items():
          stat.update(
              {
                  "policy_{}".format(policy_id): replay_buffer.stats(
                      debug=debug
                  )
              }
          )
      return stat
  
imports: import collections
  import logging
  from enum import Enum
  from typing import Any, Dict, Optional
  from ray.util.timer import _Timer
  from ray.rllib.policy.rnn_sequencing import timeslice_along_seq_lens_with_overlap
  from ray.rllib.policy.sample_batch import MultiAgentBatch, SampleBatch
  from ray.rllib.utils.annotations import override
  from ray.rllib.utils.deprecation import Deprecated
  from ray.rllib.utils.from_config import from_config
  from ray.rllib.utils.replay_buffers.replay_buffer import _ALL_POLICIES, ReplayBuffer, StorageUnit
  from ray.rllib.utils.typing import PolicyID, SampleBatchType
  from ray.util.annotations import DeveloperAPI
  from ray.util.debug import log_once
label_desc: Use image node_id 7 for calling the MultiAgentReplayBuffer obj's underlying member method code with example usage: obj.stats(debug) and returns: stat