code: def reconstruct_obs_from_h_and_z(
      h_t0_to_H,
      z_t0_to_H,
      dreamer_model,
      obs_dims_shape,
  ):
      """Returns"""
      shape = h_t0_to_H.shape
      T = shape[0]  # inputs are time-major
      B = shape[1]
      # Compute actual observations using h and z and the decoder net.
      # Note that the last h-state (T+1) is NOT used here as it's already part of
      # a new trajectory.
      # Use mean() of the Gaussian, no sample! -> No need to construct dist object here.
      reconstructed_obs_distr_means_TxB = dreamer_model.world_model.decoder(
          # Fold time rank.
          h=np.reshape(h_t0_to_H, (T * B, -1)),
          z=np.reshape(z_t0_to_H, (T * B,) + z_t0_to_H.shape[2:]),
      )
      # Unfold time rank again.
      reconstructed_obs_T_B = np.reshape(
          reconstructed_obs_distr_means_TxB, (T, B) + obs_dims_shape
      )
      # Return inverse symlog'd (real env obs space) reconstructed observations.
      return reconstructed_obs_T_B
  
file_path: ray/python/ray/rllib/algorithms/dreamerv3/utils/summaries.py
imports: import numpy
  from ray.rllib.algorithms.dreamerv3.utils.debugging import create_cartpole_dream_image, create_frozenlake_dream_image
  from ray.rllib.policy.sample_batch import SampleBatch
  from ray.rllib.utils.tf_utils import inverse_symlog
label_desc: Use image node_id 2 for calling a global function with example usage: reconstruct_obs_from_h_and_z(h_t0_to_H, z_t0_to_H, dreamer_model, obs_dims_shape) and returns: reconstructed_obs_T_B