class_docstr: Base class for Reverb adders.
class_docstr_tok: ["Base","class","for","Reverb","adders","."]
docstr: This is a helper method for generating signatures for Reverb tables.
  
  Signatures are useful for validating data types and shapes, see Reverb's
  documentation for details on how they are used.
  
  Args:
    environment_spec: A `specs.EnvironmentSpec` whose fields are nested
      structures with leaf nodes that have `.shape` and `.dtype` attributes.
      This should come from the environment that will be used to generate
      the data inserted into the Reverb table.
    extras_spec: A nested structure with leaf nodes that have `.shape` and
      `.dtype` attributes. The structure (and shapes/dtypes) of this must
      be the same as the `extras` passed into `ReverbAdder.add`.
  
  Returns:
    A `Step` whose leaf nodes are `tf.TensorSpec` objects.
docstr_tok: ["This","is","a","helper","method","for","generating","signatures","for","Reverb","tables",".","Signatures","are","useful","for","validating","data","types","and","shapes",",","see","Reverb's","documentation","for","details","on","how","they","are","used",".","Args",":","environment_spec",":","A","`","specs.EnvironmentSpec","`","whose","fields","are","nested","structures","with","leaf","nodes","that","have","`",".shape","`","and","`",".dtype","`","attributes",".","This","should","come","from","the","environment","that","will","be","used","to","generate","the","data","inserted","into","the","Reverb","table",".","extras_spec",":","A","nested","structure","with","leaf","nodes","that","have","`",".shape","`","and","`",".dtype","`","attributes",".","The","structure","(","and","shapes\/dtypes",")","of","this","must","be","the","same","as","the","`","extras","`","passed","into","`","ReverbAdder.add","`",".","Returns",":","A","`","Step","`","whose","leaf","nodes","are","`","tf.TensorSpec","`","objects","."]
code: def signature(
      cls,
      environment_spec: specs.EnvironmentSpec,
      extras_spec: types.NestedSpec = (),
  ):
      """This is a helper method for generating signatures for Reverb tables.
  
      Signatures are useful for validating data types and shapes, see Reverb's
      documentation for details on how they are used.
  
      Args:
        environment_spec: A `specs.EnvironmentSpec` whose fields are nested
          structures with leaf nodes that have `.shape` and `.dtype` attributes.
          This should come from the environment that will be used to generate
          the data inserted into the Reverb table.
        extras_spec: A nested structure with leaf nodes that have `.shape` and
          `.dtype` attributes. The structure (and shapes/dtypes) of this must
          be the same as the `extras` passed into `ReverbAdder.add`.
  
      Returns:
        A `Step` whose leaf nodes are `tf.TensorSpec` objects.
      """
      spec_step = Step(
          observation=environment_spec.observations,
          action=environment_spec.actions,
          reward=environment_spec.rewards,
          discount=environment_spec.discounts,
          start_of_episode=specs.Array(shape=(), dtype=bool),
          extras=extras_spec,
      )
      return tree.map_structure_with_path(
          spec_like_to_tensor_spec, spec_step
      )
  
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 8 for calling the ReverbAdder obj's underlying member method code with example usage: obj.signature(cls, environment_spec, extras_spec) and returns: tree