class_docstr: Replay buffer for HER (Hindsight Experience Replay).
  
  It constructs hindsight examples using future strategy.
  
  Args:
      replay_k (int): Number of HER transitions to add for each regular
          Transition. Setting this to 0 means that no HER replays will
          be added.
      reward_fn (callable): Function to re-compute the reward with
          substituted goals.
      capacity_in_transitions (int): total size of transitions in the buffer.
      env_spec (EnvSpec): Environment specification.
class_docstr_tok: ["Replay","buffer","for","HER","(","Hindsight","Experience","Replay",")",".","It","constructs","hindsight","examples","using","future","strategy",".","Args",":","replay_k","(","int",")",":","Number","of","HER","transitions","to","add","for","each","regular","Transition",".","Setting","this","to","0","means","that","no","HER","replays","will","be","added",".","reward_fn","(","callable",")",":","Function","to","re-compute","the","reward","with","substituted","goals",".","capacity_in_transitions","(","int",")",":","total","size","of","transitions","in","the","buffer",".","env_spec","(","EnvSpec",")",":","Environment","specification","."]
code: def _flatten_dicts(self, path):
      for key in ["observations", "next_observations"]:
          if not isinstance(path[key], dict):
              path[key] = self._env_spec.observation_space.flatten_n(
                  path[key]
              )
          else:
              path[key] = self._env_spec.observation_space.flatten(
                  path[key]
              )
  
file_path: garage/src/garage/replay_buffer/her_replay_buffer.py
imports: import copy
  import numpy
  from garage.replay_buffer.path_buffer import PathBuffer
label_desc: Use image node_id 3 for calling the HERReplayBuffer obj's underlying member method code with example usage: obj._flatten_dicts(path) without return types