code: def compute_q_values(
      policy: Policy,
      model: ModelV2,
      input_dict,
      state_batches=None,
      seq_lens=None,
      explore=None,
      is_training: bool = False,
  ):
      config = policy.config
  
      model_out, state = model(
          input_dict, state_batches or [], seq_lens
      )
  
      if config["num_atoms"] > 1:
          (
              action_scores,
              z,
              support_logits_per_action,
              logits,
              probs_or_logits,
          ) = model.get_q_value_distributions(model_out)
      else:
          (
              action_scores,
              logits,
              probs_or_logits,
          ) = model.get_q_value_distributions(model_out)
  
      if config["dueling"]:
          state_score = model.get_state_value(model_out)
          if policy.config["num_atoms"] > 1:
              support_logits_per_action_mean = torch.mean(
                  support_logits_per_action, dim=1
              )
              support_logits_per_action_centered = (
                  support_logits_per_action
                  - torch.unsqueeze(
                      support_logits_per_action_mean, dim=1
                  )
              )
              support_logits_per_action = (
                  torch.unsqueeze(state_score, dim=1)
                  + support_logits_per_action_centered
              )
              support_prob_per_action = nn.functional.softmax(
                  support_logits_per_action, dim=-1
              )
              value = torch.sum(z * support_prob_per_action, dim=-1)
              logits = support_logits_per_action
              probs_or_logits = support_prob_per_action
          else:
              advantages_mean = reduce_mean_ignore_inf(action_scores, 1)
              advantages_centered = action_scores - torch.unsqueeze(
                  advantages_mean, 1
              )
              value = state_score + advantages_centered
      else:
          value = action_scores
  
      return value, logits, probs_or_logits, state
  
imports: from typing import Dict, List, Tuple
  import gymnasium
  import ray
  from ray.rllib.algorithms.dqn.dqn_tf_policy import PRIO_WEIGHTS, Q_SCOPE, Q_TARGET_SCOPE, postprocess_nstep_and_prio
  from ray.rllib.algorithms.dqn.dqn_torch_model import DQNTorchModel
  from ray.rllib.models.catalog import ModelCatalog
  from ray.rllib.models.modelv2 import ModelV2
  from ray.rllib.models.torch.torch_action_dist import get_torch_categorical_class_with_temperature, TorchDistributionWrapper
  from ray.rllib.policy.policy import Policy
  from ray.rllib.policy.policy_template import build_policy_class
  from ray.rllib.policy.sample_batch import SampleBatch
  from ray.rllib.policy.torch_mixins import LearningRateSchedule, TargetNetworkMixin
  from ray.rllib.utils.error import UnsupportedSpaceException
  from ray.rllib.utils.exploration.parameter_noise import ParameterNoise
  from ray.rllib.utils.framework import try_import_torch
  from ray.rllib.utils.torch_utils import apply_grad_clipping, concat_multi_gpu_td_errors, FLOAT_MIN, huber_loss, l2_loss, reduce_mean_ignore_inf, softmax_cross_entropy_with_logits
  from ray.rllib.utils.typing import TensorType, AlgorithmConfigDict
label_desc: Use image node_id 8 for calling a global function with example usage: compute_q_values(policy, model, input_dict, state_batches, seq_lens, explore, is_training) and returns: value,  logits,  probs_or_logits,  state