class_docstr: Initializes a SlateQTFModel instance.
  
  Model includes both the user choice model and the Q-value model.
  
  For the Q-value model, each document candidate receives one full Q-value
  stack, defined by `fcnet_hiddens_per_candidate`. The input to each of these
  Q-value stacks is always {[user] concat [document[i]] for i in document_candidates}.
  
  Extra model kwargs:
      fcnet_hiddens_per_candidate: List of layer-sizes for each(!) of the
          candidate documents.
class_docstr_tok: ["Initializes","a","SlateQTFModel","instance",".","Model","includes","both","the","user","choice","model","and","the","Q-value","model",".","For","the","Q-value","model",",","each","document","candidate","receives","one","full","Q-value","stack",",","defined","by","`","fcnet_hiddens_per_candidate","`",".","The","input","to","each","of","these","Q-value","stacks","is","always","{","[","user","]","concat","[","document","[","i","]","]","for","i","in","document_candidates","}",".","Extra","model","kwargs",":","fcnet_hiddens_per_candidate",":","List","of","layer-sizes","for","each","(","!",")","of","the","candidate","documents","."]
docstr: Initializes a SlateQModel instance.
  
  Args:
      user_embedding_size: The size of the user embedding (number of
          user specific features).
      doc_embedding_size: The size of the doc embedding (number of doc
          specific features).
      num_docs: The number of docs to select a slate from. Note that the slate
          size is inferred from the action space.
      fcnet_hiddens_per_candidate: List of layer-sizes for each(!) of the
          candidate documents.
      double_q: Whether "double Q-learning" is applied in the loss function.
docstr_tok: ["Initializes","a","SlateQModel","instance",".","Args",":","user_embedding_size",":","The","size","of","the","user","embedding","(","number","of","user","specific","features",")",".","doc_embedding_size",":","The","size","of","the","doc","embedding","(","number","of","doc","specific","features",")",".","num_docs",":","The","number","of","docs","to","select","a","slate","from",".","Note","that","the","slate","size","is","inferred","from","the","action","space",".","fcnet_hiddens_per_candidate",":","List","of","layer-sizes","for","each","(","!",")","of","the","candidate","documents",".","double_q",":","Whether","``","double","Q-learning","''","is","applied","in","the","loss","function","."]
code: def __init__(
      self,
      obs_space: gym.spaces.Space,
      action_space: gym.spaces.Space,
      num_outputs: int,
      model_config: ModelConfigDict,
      name: str,
      *,
      fcnet_hiddens_per_candidate: Sequence[int] = (256, 32),
      double_q: bool = True,
  ):
      """Initializes a SlateQModel instance.
  
      Args:
          user_embedding_size: The size of the user embedding (number of
              user specific features).
          doc_embedding_size: The size of the doc embedding (number of doc
              specific features).
          num_docs: The number of docs to select a slate from. Note that the slate
              size is inferred from the action space.
          fcnet_hiddens_per_candidate: List of layer-sizes for each(!) of the
              candidate documents.
          double_q: Whether "double Q-learning" is applied in the loss function.
      """
      nn.Module.__init__(self)
      TorchModelV2.__init__(
          self,
          obs_space,
          action_space,
          # This required parameter (num_outputs) seems redundant: it has no
          # real impact, and can be set arbitrarily. TODO: fix this.
          num_outputs=0,
          model_config=model_config,
          name=name,
      )
      self.num_outputs = num_outputs
  
      self.choice_model = UserChoiceModel()
  
      self.q_model = QValueModel(
          self.obs_space, fcnet_hiddens_per_candidate
      )
  
file_path: ray/rllib_contrib/slate_q/src/rllib_slate_q/slate_q/slateq_torch_model.py
imports: from typing import List, Sequence
  import gymnasium
  from ray.rllib.models.torch.misc import SlimFC
  from ray.rllib.models.torch.torch_modelv2 import TorchModelV2
  from ray.rllib.utils.framework import try_import_torch
  from ray.rllib.utils.typing import ModelConfigDict, TensorType
label_desc: Use image node_id 1 to create a new SlateQTorchModel object from inherited base classes: TorchModelV2, nn with example: obj = SlateQTorchModel(obs_space, action_space, num_outputs, model_config, name)