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 list of variables for Q / twin Q nets.
docstr_tok: ["Return","the","list","of","variables","for","Q","\/","twin","Q","nets","."]
code: def q_variables(
      self, as_dict=False
  ) -> Union[List[TensorType], Dict[str, TensorType]]:
      """Return the list of variables for Q / twin Q nets."""
      if as_dict:
          return {
              **self.q_model.state_dict(),
              **(
                  self.twin_q_model.state_dict()
                  if self.twin_q_model
                  else {}
              ),
          }
      return list(self.q_model.parameters()) + (
          list(self.twin_q_model.parameters())
          if self.twin_q_model
          else []
      )
  
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 6 for calling the DDPGTorchModel obj's underlying member method code with example usage: obj.q_variables(as_dict) and returns: unknown, dict