class_docstr: Stateful observer for writing fixed length trajectories to Reverb.
  
  This observer should be called at every environment step. It does not support
  batched trajectories.
  
  Steps are cached until `sequence_length` steps are gathered. At which point an
  item is created. From there on a new item is created every `stride_length`
  observer calls.
  
  If an episode terminates before enough steps are cached, the data is discarded
  unless `pad_end_of_episodes` is set.
docstr: Writes the trajectory into the underlying replay buffer.
  
  Allows trajectory to be a flattened trajectory. No batch dimension allowed.
  
  Args:
    trajectory: The trajectory to be written which could be (possibly nested)
      trajectory object or a flattened version of a trajectory. It assumes
      there is *no* batch dimension.
code: def __call__(self, trajectory: trajectory_lib.Trajectory) -> None:
      """Writes the trajectory into the underlying replay buffer.
  
      Allows trajectory to be a flattened trajectory. No batch dimension allowed.
  
      Args:
        trajectory: The trajectory to be written which could be (possibly nested)
          trajectory object or a flattened version of a trajectory. It assumes
          there is *no* batch dimension.
      """
      self._last_trajectory = trajectory
      self._get_writer().append(trajectory)
      self._cached_steps += 1
  
      # If the fixed sequence length is reached, write the sequence.
      self._write_cached_steps()
  
      # If it happens to be the end of the episode, clear the cache. Pad first and
      # write the items into Reverb if required.
      if trajectory.is_boundary():
          if self._pad_end_of_episodes:
              self.reset(write_cached_steps=True)
          else:
              self.reset(write_cached_steps=False)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from typing import Sequence, Text, Union
  from absl import logging
  import tensorflow
  from tf_agents.trajectories import trajectory
  from tf_agents.typing import types
  from tf_agents.utils import lazy_loader
label_desc: Use image node_id 5 for calling the ReverbAddTrajectoryObserver obj's underlying member method code with example usage: obj.__call__(trajectory) without return types