code: def _compute_action_weights_and_logps(
      self,
      model: ModelV2,
      dist_class: Type[TorchDistributionWrapper],
      train_batch: SampleBatch,
  ) -> None:
      # uses bin|exp to compute action weights
      # 1(A>=0) or exp(A/temp)
  
      weight_type = self.config["weight_type"]
      self._compute_adv_and_logps(model, dist_class, train_batch)
  
      if weight_type == "bin":
          weights = (train_batch["advantages"] > 0.0).float()
      elif weight_type == "exp":
          temperature = self.config["temperature"]
          max_weight = self.config["max_weight"]
          weights = (
              (train_batch["advantages"] / temperature)
              .exp()
              .clamp(0.0, max_weight)
          )
      else:
          raise ValueError(f"invalid weight type: {weight_type}.")
  
      train_batch["action_weights"] = weights
  
      # logging
      self.log("weights_avg", weights.mean())
      self.log("weights_max", weights.max())
      self.log("weights_min", weights.min())
  
imports: from typing import Dict, List, Tuple, Type, Union, cast
  import gymnasium
  import numpy
  from rllib_crr.crr.crr_torch_model import CRRModel
  from ray.rllib.algorithms import AlgorithmConfig
  from ray.rllib.algorithms.ddpg.noop_model import TorchNoopModel
  from ray.rllib.models.catalog import ModelCatalog
  from ray.rllib.models.modelv2 import ModelV2
  from ray.rllib.models.torch.torch_action_dist import TorchCategorical, TorchDistributionWrapper, get_torch_categorical_class_with_temperature
  from ray.rllib.policy.sample_batch import SampleBatch
  from ray.rllib.policy.torch_mixins import TargetNetworkMixin
  from ray.rllib.policy.torch_policy_v2 import TorchPolicyV2
  from ray.rllib.utils.annotations import override
  from ray.rllib.utils.framework import try_import_torch
  from ray.rllib.utils.torch_utils import huber_loss, l2_loss
  from ray.rllib.utils.typing import TensorType, TrainerConfigDict
label_desc: Use image node_id 10 for calling the CRRTorchPolicy obj's underlying member method code with example usage: obj._compute_action_weights_and_logps(model, dist_class, train_batch) without return types