class_docstr: Base class for RLlib's TensorFlow models.
  
  This class defines the interface for RLlib's TensorFlow models and checks
  whether inputs and outputs of __call__ are checked with `check_input_specs()` and
  `check_output_specs()` respectively.
class_docstr_tok: ["Base","class","for","RLlib","'s","TensorFlow","models",".","This","class","defines","the","interface","for","RLlib","'s","TensorFlow","models","and","checks","whether","inputs","and","outputs","of","__call__","are","checked","with","`","check_input_specs","(",")","`","and","`","check_output_specs","(",")","`","respectively","."]
code: def __init__(self, config: ModelConfig):
      tf.keras.Model.__init__(self)
      Model.__init__(self, config)
  
      # Raise errors if forward method is not decorated to check input specs.
      if not is_input_decorated(self.call):
          raise ValueError(
              f"`{type(self).__name__}.call()` not decorated with input "
              f"specification. Decorate it with @check_input_specs() to define a "
              f"specification and resolve this Error. If you don't want to check "
              f"anything, you can use an empty spec."
          )
  
      if is_output_decorated(self.call):
          if log_once("tf_model_forward_output_decorated"):
              logger.warning(
                  f"`{type(self).__name__}.call()` decorated with output "
                  f"specification. This is not recommended because it can lead to "
                  f"slower execution. Remove @check_output_specs() from the "
                  f"forward method to resolve this."
              )
  
file_path: ray/rllib/core/models/tf/base.py
imports: import abc
  import logging
  from typing import Tuple
  import numpy
  from ray.rllib.core.models.base import Model
  from ray.rllib.core.models.configs import ModelConfig
  from ray.rllib.core.models.specs.checker import check_input_specs, is_input_decorated, is_output_decorated, check_output_specs
  from ray.rllib.utils.annotations import override
  from ray.rllib.utils.framework import try_import_tf
  from ray.util import log_once
label_desc: Use image node_id 1 to create a new TfModel object from inherited base classes: Model, tf.keras, abc with example: obj = TfModel(config)