class_docstr: Extension of standard TorchModelV2 for DDPG.
  
  Data flow:
      obs -> forward() -> model_out
      model_out -> get_policy_output() -> pi(s)
      model_out, actions -> get_q_values() -> Q(s, a)
      model_out, actions -> get_twin_q_values() -> Q_twin(s, a)
  
  Note that this class by itself is not a valid model unless you
  implement forward() in a subclass.
class_docstr_tok: ["Extension","of","standard","TorchModelV2","for","DDPG",".","Data","flow",":","obs","-",">","forward","(",")","-",">","model_out","model_out","-",">","get_policy_output","(",")","-",">","pi","(","s",")","model_out",",","actions","-",">","get_q_values","(",")","-",">","Q","(","s",",","a",")","model_out",",","actions","-",">","get_twin_q_values","(",")","-",">","Q_twin","(","s",",","a",")","Note","that","this","class","by","itself","is","not","a","valid","model","unless","you","implement","forward","(",")","in","a","subclass","."]
docstr: Return the Q estimates for the most recent forward pass.
  
  This implements Q(s, a).
  
  Args:
      model_out: obs embeddings from the model layers, of shape
          [BATCH_SIZE, num_outputs].
      actions: Actions to return the Q-values for.
          Shape: [BATCH_SIZE, action_dim].
  
  Returns:
      tensor of shape [BATCH_SIZE].
docstr_tok: ["Return","the","Q","estimates","for","the","most","recent","forward","pass",".","This","implements","Q","(","s",",","a",")",".","Args",":","model_out",":","obs","embeddings","from","the","model","layers",",","of","shape","[","BATCH_SIZE",",","num_outputs","]",".","actions",":","Actions","to","return","the","Q-values","for",".","Shape",":","[","BATCH_SIZE",",","action_dim","]",".","Returns",":","tensor","of","shape","[","BATCH_SIZE","]","."]
code: def get_q_values(
      self, model_out: TensorType, actions: TensorType
  ) -> TensorType:
      """Return the Q estimates for the most recent forward pass.
  
      This implements Q(s, a).
  
      Args:
          model_out: obs embeddings from the model layers, of shape
              [BATCH_SIZE, num_outputs].
          actions: Actions to return the Q-values for.
              Shape: [BATCH_SIZE, action_dim].
  
      Returns:
          tensor of shape [BATCH_SIZE].
      """
      return self.q_model(torch.cat([model_out, actions], -1))
  
file_path: ray/rllib_contrib/ddpg/src/rllib_ddpg/ddpg/ddpg_torch_model.py
imports: from typing import Dict, List, Optional, Union
  import gymnasium
  import numpy
  from ray.rllib.models.torch.misc import SlimFC
  from ray.rllib.models.torch.torch_modelv2 import TorchModelV2
  from ray.rllib.models.utils import get_activation_fn
  from ray.rllib.utils.framework import try_import_torch
  from ray.rllib.utils.typing import ModelConfigDict, TensorType
label_desc: Use image node_id 2 for calling the DDPGTorchModel obj's underlying member method code with example usage: obj.get_q_values(model_out, actions) and returns: self