class_docstr: Saves some frames in a memory efficient way.
  
  Thread safety: cannot add multiple frames in parallel.
class_docstr_tok: ["Saves","some","frames","in","a","memory","efficient","way",".","Thread","safety",":","can","not","add","multiple","frames","in","parallel","."]
docstr: Add a frame to the buffer.
  
  Args:
    frame: Numpy array.
  
  Returns:
    A deduplicated frame.
docstr_tok: ["Add","a","frame","to","the","buffer",".","Args",":","frame",":","Numpy","array",".","Returns",":","A","deduplicated","frame","."]
code: def add_frame(self, frame):
      """Add a frame to the buffer.
  
      Args:
        frame: Numpy array.
  
      Returns:
        A deduplicated frame.
      """
      h = hash(frame.tobytes())
      if h in self._frames:
          _, refcount = self._frames[h]
          self._frames[h] = (frame, refcount + 1)
          return h
      self._frames[h] = (frame, 1)
      return h
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import pickle
  import threading
  from absl import logging
  import numpy
  import tensorflow
  from tf_agents.replay_buffers import py_uniform_replay_buffer
  from tf_agents.specs import array_spec
  from tf_agents.trajectories import trajectory
label_desc: Use image node_id 2 for calling the FrameBuffer obj's underlying member method code with example usage: obj.add_frame(frame) and returns: h, h