class_docstr: Wrapper that concatenates observation fields.
  
  It takes an environment with nested observations and concatenates the fields
  in a single tensor. The original fields should be 1-dimensional.
  Observation fields that are not in name_filter are dropped.
  
  **NOTE**: The fields in the flattened observations will be in sorted order by
  their names, see tree.flatten for more information.
class_docstr_tok: ["Wrapper","that","concatenates","observation","fields",".","It","takes","an","environment","with","nested","observations","and","concatenates","the","fields","in","a","single","tensor",".","The","original","fields","should","be","1-dimensional",".","Observation","fields","that","are","not","in","name_filter","are","dropped",".","*","*","NOTE","*","*",":","The","fields","in","the","flattened","observations","will","be","in","sorted","order","by","their","names",",","see","tree.flatten","for","more","information","."]
docstr: Initializes a new ConcatObservationWrapper.
  
  Args:
    environment: Environment to wrap.
    name_filter: Sequence of observation names to keep. None keeps them all.
docstr_tok: ["Initializes","a","new","ConcatObservationWrapper",".","Args",":","environment",":","Environment","to","wrap",".","name_filter",":","Sequence","of","observation","names","to","keep",".","None","keeps","them","all","."]
code: def __init__(
      self,
      environment: dm_env.Environment,
      name_filter: Optional[Sequence[str]] = None,
  ):
      """Initializes a new ConcatObservationWrapper.
  
      Args:
        environment: Environment to wrap.
        name_filter: Sequence of observation names to keep. None keeps them all.
      """
      super().__init__(environment)
      observation_spec = environment.observation_spec()
      if name_filter is None:
          name_filter = list(observation_spec.keys())
      self._obs_names = [
          x for x in name_filter if x in observation_spec.keys()
      ]
  
      dummy_obs = _zeros_like(observation_spec)
      dummy_obs = self._convert_observation(dummy_obs)
      self._observation_spec = dm_env.specs.BoundedArray(
          shape=dummy_obs.shape,
          dtype=dummy_obs.dtype,
          minimum=-np.inf,
          maximum=np.inf,
          name="state",
      )
  
file_path: acme/acme/wrappers/concatenate_observations.py
imports: from typing import Sequence, Optional
  from acme import types
  from acme.wrappers import base
  import dm_env
  import numpy
  import tree
label_desc: Use image node_id 1 to create a new ConcatObservationWrapper object from inherited base classes: base with example: obj = ConcatObservationWrapper(environment, name_filter)