class_docstr: Implements DreamerV3 losses and gradient-based update logic in TensorFlow.
  
  The critic EMA-copy update step can be found in the `DreamerV3Learner` base class,
  as it is framework independent.
  
  We define 3 local TensorFlow optimizers for the sub components "world_model",
  "actor", and "critic". Each of these optimizers might use a different learning rate,
  epsilon parameter, and gradient clipping thresholds and procedures.
docstr: Helper method computing the scaled value targets.
  
  Args:
      module_id: The module_id to compute value targets for.
      config: The DreamerV3Config to use.
      value_targets_t0_to_Hm1_BxT: The value targets computed by
          `self._compute_value_targets` in the shape of (t0 to H-1, BxT)
          and of type float32.
      value_predictions_t0_to_Hm1_BxT: The critic's value predictions over the
          dreamed trajectories (w/o the last timestep). The shape of this
          tensor is (t0 to H-1, BxT) and the type is float32.
  
  Returns:
      The scaled value targets used by the actor for REINFORCE policy updates
      (using scaled advantages). See [1] eq. 12 for more details.
docstr_tok: ["Helper","method","computing","the","scaled","value","targets",".","Args",":","module_id",":","The","module_id","to","compute","value","targets","for",".","config",":","The","DreamerV3Config","to","use",".","value_targets_t0_to_Hm1_BxT",":","The","value","targets","computed","by","`","self._compute_value_targets","`","in","the","shape","of","(","t0","to","H-1",",","BxT",")","and","of","type","float32",".","value_predictions_t0_to_Hm1_BxT",":","The","critic","'s","value","predictions","over","the","dreamed","trajectories","(","w\/o","the","last","timestep",")",".","The","shape","of","this","tensor","is","(","t0","to","H-1",",","BxT",")","and","the","type","is","float32",".","Returns",":","The","scaled","value","targets","used","by","the","actor","for","REINFORCE","policy","updates","(","using","scaled","advantages",")",".","See","[","1","]","eq",".","12","for","more","details","."]
code: def _compute_scaled_value_targets(
      self,
      *,
      module_id: ModuleID,
      config: DreamerV3Config,
      value_targets_t0_to_Hm1_BxT: TensorType,
      value_predictions_t0_to_Hm1_BxT: TensorType,
  ) -> TensorType:
      """Helper method computing the scaled value targets.
  
      Args:
          module_id: The module_id to compute value targets for.
          config: The DreamerV3Config to use.
          value_targets_t0_to_Hm1_BxT: The value targets computed by
              `self._compute_value_targets` in the shape of (t0 to H-1, BxT)
              and of type float32.
          value_predictions_t0_to_Hm1_BxT: The critic's value predictions over the
              dreamed trajectories (w/o the last timestep). The shape of this
              tensor is (t0 to H-1, BxT) and the type is float32.
  
      Returns:
          The scaled value targets used by the actor for REINFORCE policy updates
          (using scaled advantages). See [1] eq. 12 for more details.
      """
      actor = self.module[module_id].actor
  
      value_targets_H_B = value_targets_t0_to_Hm1_BxT
      value_predictions_H_B = value_predictions_t0_to_Hm1_BxT
  
      # Compute S: [1] eq. 12.
      Per_R_5 = tfp.stats.percentile(value_targets_H_B, 5)
      Per_R_95 = tfp.stats.percentile(value_targets_H_B, 95)
  
      # Update EMA values for 5 and 95 percentile, stored as tf variables under actor
      # network.
      # 5 percentile
      new_val_pct5 = tf.where(
          tf.math.is_nan(actor.ema_value_target_pct5),
          # is NaN: Initial values: Just set.
          Per_R_5,
          # Later update (something already stored in EMA variable): Update EMA.
          (
              config.return_normalization_decay
              * actor.ema_value_target_pct5
              + (1.0 - config.return_normalization_decay) * Per_R_5
          ),
      )
      actor.ema_value_target_pct5.assign(new_val_pct5)
      # 95 percentile
      new_val_pct95 = tf.where(
          tf.math.is_nan(actor.ema_value_target_pct95),
          # is NaN: Initial values: Just set.
          Per_R_95,
          # Later update (something already stored in EMA variable): Update EMA.
          (
              config.return_normalization_decay
              * actor.ema_value_target_pct95
              + (1.0 - config.return_normalization_decay) * Per_R_95
          ),
      )
      actor.ema_value_target_pct95.assign(new_val_pct95)
  
      # [1] eq. 11 (first term).
      offset = actor.ema_value_target_pct5
      invscale = tf.math.maximum(
          1e-8,
          actor.ema_value_target_pct95 - actor.ema_value_target_pct5,
      )
      scaled_value_targets_H_B = (value_targets_H_B - offset) / invscale
      scaled_value_predictions_H_B = (
          value_predictions_H_B - offset
      ) / invscale
  
      # Return advantages.
      return scaled_value_targets_H_B - scaled_value_predictions_H_B
  
imports: from typing import Any, Dict, Tuple
  import gymnasium
  from ray.rllib.algorithms.dreamerv3.dreamerv3 import DreamerV3Config
  from ray.rllib.algorithms.dreamerv3.dreamerv3_learner import DreamerV3Learner
  from ray.rllib.core.learner.learner import ParamDict
  from ray.rllib.core.learner.tf.tf_learner import TfLearner
  from ray.rllib.policy.sample_batch import DEFAULT_POLICY_ID, SampleBatch
  from ray.rllib.utils.annotations import override
  from ray.rllib.utils.deprecation import deprecation_warning
  from ray.rllib.utils.framework import try_import_tf, try_import_tfp
  from ray.rllib.utils.tf_utils import symlog, two_hot, clip_gradients
  from ray.rllib.utils.typing import ModuleID, TensorType
label_desc: Use image node_id 10 for calling the DreamerV3TfLearner obj's underlying member method code with example usage: obj._compute_scaled_value_targets() and returns: unknown