class_docstr: Framework-agnostic base class for RLlib models.
  
  Models are low-level neural network components that offer input- and
  output-specification, a forward method, and a get_initial_state method. Models
  are composed in RLModules.
  
  Usage Example together with ModelConfig:
  
  .. testcode::
  
      from ray.rllib.core.models.base import Model
      from ray.rllib.core.models.configs import ModelConfig
      from dataclasses import dataclass
  
      class MyModel(Model):
          def __init__(self, config):
              super().__init__(config)
              self.my_param = config.my_param * 2
  
          def _forward(self, input_dict):
              return input_dict["obs"] * self.my_param
  
  
      @dataclass
      class MyModelConfig(ModelConfig):
          my_param: int = 42
  
          def build(self, framework: str):
              if framework == "bork":
                  return MyModel(self)
  
  
      config = MyModelConfig(my_param=3)
      model = config.build(framework="bork")
      print(model._forward({"obs": 1}))
  
  .. testoutput::
  
      6
class_docstr_tok: ["Framework-agnostic","base","class","for","RLlib","models",".","Models","are","low-level","neural","network","components","that","offer","input-","and","output-specification",",","a","forward","method",",","and","a","get_initial_state","method",".","Models","are","composed","in","RLModules",".","Usage","Example","together","with","ModelConfig",":","..","testcode",":",":","from","ray.rllib.core.models.base","import","Model","from","ray.rllib.core.models.configs","import","ModelConfig","from","dataclasses","import","dataclass","class","MyModel","(","Model",")",":","def","__init__","(","self",",","config",")",":","super","(",")",".__init__","(","config",")","self.my_param","=","config.my_param","*","2","def","_forward","(","self",",","input_dict",")",":","return","input_dict","[","``","obs","''","]","*","self.my_param","@","dataclass","class","MyModelConfig","(","ModelConfig",")",":","my_param",":","int","=","42","def","build","(","self",",","framework",":","str",")",":","if","framework","==","``","bork","''",":","return","MyModel","(","self",")","config","=","MyModelConfig","(","my_param=3",")","model","=","config.build","(","framework=","''","bork","''",")","print","(","model._forward","(","{","``","obs","''",":","1","}",")",")","..","testoutput",":",":","6"]
docstr: Returns the output of this model for the given input.
  
  This method is called by the forwarding method of the respective framework
  that is itself wrapped by RLlib in order to check model inputs and outputs.
  
  Args:
      input_dict: The input tensors.
      **kwargs: Forward compatibility kwargs.
  
  Returns:
      dict: The output tensors.
code: def _forward(self, input_dict: dict, **kwargs) -> dict:
      """Returns the output of this model for the given input.
  
      This method is called by the forwarding method of the respective framework
      that is itself wrapped by RLlib in order to check model inputs and outputs.
  
      Args:
          input_dict: The input tensors.
          **kwargs: Forward compatibility kwargs.
  
      Returns:
          dict: The output tensors.
      """
  
imports: import abc
  from typing import List, Optional, Tuple, Union
  from ray.rllib.core.models.configs import ModelConfig
  from ray.rllib.core.models.specs.specs_base import Spec
  from ray.rllib.policy.sample_batch import SampleBatch
  from ray.rllib.policy.rnn_sequencing import get_fold_unfold_fns
  from ray.rllib.utils.annotations import ExperimentalAPI, DeveloperAPI
  from ray.rllib.utils.annotations import override
  from ray.rllib.utils.typing import TensorType
label_desc: Use image node_id 11 for calling the Model obj's underlying member method code with example usage: obj._forward(input_dict) without return types