code: def __init__(self, obs_space, action_space, config):
      super().__init__(obs_space, action_space, config)
      self.action_space_struct = get_base_struct_from_space(
          action_space
      )
      self.action_noise_std = self.config["action_noise_std"]
      self.preprocessor = ModelCatalog.get_preprocessor_for_space(
          obs_space
      )
      self.observation_filter = get_filter(
          self.config["observation_filter"], self.preprocessor.shape
      )
      if self.config["framework"] == "tf":
          self.sess = make_session(
              single_threaded=self.config.get(
                  "tf_single_threaded", True
              )
          )
  
          # Set graph-level seed.
          if config.get("seed") is not None:
              with self.sess.as_default():
                  tf1.set_random_seed(config["seed"])
  
          self.inputs = tf1.placeholder(
              tf.float32, [None] + list(self.preprocessor.shape)
          )
      else:
          if not tf1.executing_eagerly():
              tf1.enable_eager_execution()
          self.sess = self.inputs = None
          if config.get("seed") is not None:
              # Tf2.x.
              if tfv == 2:
                  tf.random.set_seed(config["seed"])
              # Tf1.x.
              else:
                  tf1.set_random_seed(config["seed"])
  
      # Policy network.
      self.dist_class, dist_dim = ModelCatalog.get_action_dist(
          self.action_space,
          self.config["model"],
          dist_type="deterministic",
      )
  
      self.model = ModelCatalog.get_model_v2(
          obs_space=self.preprocessor.observation_space,
          action_space=action_space,
          num_outputs=dist_dim,
          model_config=self.config["model"],
      )
  
      self.sampler = None
      if self.sess:
          dist_inputs, _ = self.model(
              {SampleBatch.CUR_OBS: self.inputs}
          )
          dist = self.dist_class(dist_inputs, self.model)
          self.sampler = dist.sample()
          self.variables = (
              ray.experimental.tf_utils.TensorFlowVariables(
                  dist_inputs, self.sess
              )
          )
          self.sess.run(tf1.global_variables_initializer())
      else:
          self.variables = (
              ray.experimental.tf_utils.TensorFlowVariables(
                  [], None, self.model.variables()
              )
          )
  
      self.num_params = sum(
          np.prod(variable.shape.as_list())
          for _, variable in self.variables.variables.items()
      )
  
imports: from typing import Optional
  import gymnasium
  import numpy
  import tree
  import ray
  import ray.experimental.tf_utils
  from ray.rllib.models import ModelCatalog
  from ray.rllib.policy.policy import Policy
  from ray.rllib.policy.sample_batch import SampleBatch
  from ray.rllib.utils import deprecation_warning
  from ray.rllib.utils.annotations import override
  from ray.rllib.utils.filter import get_filter
  from ray.rllib.utils.framework import try_import_tf
  from ray.rllib.utils.spaces.space_utils import get_base_struct_from_space, unbatch
label_desc: Use image node_id 1 to create a new ESTFPolicy object from inherited base classes: Policy with example: obj = ESTFPolicy(obs_space, action_space, config)