class_docstr: Base class for Reverb adders.
class_docstr_tok: ["Base","class","for","Reverb","adders","."]
docstr: Initialize a ReverbAdder instance.
  
  Args:
    client: A client to the Reverb backend.
    max_sequence_length: The maximum length of sequences (corresponding to the
      number of observations) that can be added to replay.
    max_in_flight_items: The maximum number of items allowed to be "in flight"
      at the same time. See `block_until_num_items` in
      `reverb.TrajectoryWriter.flush` for more info.
    delta_encoded: If `True` (False by default) enables delta encoding, see
      `Client` for more information.
    priority_fns: A mapping from table names to priority functions; if
      omitted, all transitions/steps/sequences are given uniform priorities
      (1.0) and placed in DEFAULT_PRIORITY_TABLE.
    validate_items: Whether to validate items against the table signature
      before they are sent to the server. This requires table signature to be
      fetched from the server and cached locally.
docstr_tok: ["Initialize","a","ReverbAdder","instance",".","Args",":","client",":","A","client","to","the","Reverb","backend",".","max_sequence_length",":","The","maximum","length","of","sequences","(","corresponding","to","the","number","of","observations",")","that","can","be","added","to","replay",".","max_in_flight_items",":","The","maximum","number","of","items","allowed","to","be","``","in","flight","''","at","the","same","time",".","See","`","block_until_num_items","`","in","`","reverb.TrajectoryWriter.flush","`","for","more","info",".","delta_encoded",":","If","`","True","`","(","False","by","default",")","enables","delta","encoding",",","see","`","Client","`","for","more","information",".","priority_fns",":","A","mapping","from","table","names","to","priority","functions",";","if","omitted",",","all","transitions\/steps\/sequences","are","given","uniform","priorities","(","1.0",")","and","placed","in","DEFAULT_PRIORITY_TABLE",".","validate_items",":","Whether","to","validate","items","against","the","table","signature","before","they","are","sent","to","the","server",".","This","requires","table","signature","to","be","fetched","from","the","server","and","cached","locally","."]
code: def __init__(
      self,
      client: reverb.Client,
      max_sequence_length: int,
      max_in_flight_items: int,
      delta_encoded: bool = False,
      priority_fns: Optional[PriorityFnMapping] = None,
      validate_items: bool = True,
  ):
      """Initialize a ReverbAdder instance.
  
      Args:
        client: A client to the Reverb backend.
        max_sequence_length: The maximum length of sequences (corresponding to the
          number of observations) that can be added to replay.
        max_in_flight_items: The maximum number of items allowed to be "in flight"
          at the same time. See `block_until_num_items` in
          `reverb.TrajectoryWriter.flush` for more info.
        delta_encoded: If `True` (False by default) enables delta encoding, see
          `Client` for more information.
        priority_fns: A mapping from table names to priority functions; if
          omitted, all transitions/steps/sequences are given uniform priorities
          (1.0) and placed in DEFAULT_PRIORITY_TABLE.
        validate_items: Whether to validate items against the table signature
          before they are sent to the server. This requires table signature to be
          fetched from the server and cached locally.
      """
      if priority_fns:
          priority_fns = dict(priority_fns)
      else:
          priority_fns = {DEFAULT_PRIORITY_TABLE: None}
  
      self._client = client
      self._priority_fns = priority_fns
      self._max_sequence_length = max_sequence_length
      self._delta_encoded = delta_encoded
      # TODO(b/206629159): Remove this.
      self._max_in_flight_items = max_in_flight_items
      self._add_first_called = False
  
      # This is exposed as the _writer property in such a way that it will create
      # a new writer automatically whenever the internal __writer is None. Users
      # should ONLY ever interact with self._writer.
      self.__writer = None
      # Every time a new writer is created, it must fetch the signature from the
      # Reverb server. If this is set too low it can crash the adders in a
      # distributed setup where the replay may take a while to spin up.
      self._validate_items = validate_items
  
imports: import abc
  import time
  from typing import Callable, Iterable, Mapping, NamedTuple, Optional, Sized, Union, Tuple
  from absl import logging
  from acme import specs
  from acme import types
  from acme.adders import base
  import dm_env
  import numpy
  import reverb
  import tensorflow
  import tree
label_desc: Use image node_id 1 to create a new ReverbAdder object from inherited base classes: base with example: obj = ReverbAdder(client, max_sequence_length, max_in_flight_items, delta_encoded, priority_fns, validate_items)