class_docstr: Exposes a Python policy as wrapper over a TF Policy.
class_docstr_tok: ["Exposes","a","Python","policy","as","wrapper","over","a","TF","Policy","."]
docstr: Initializes a new `PyTFPolicy`.
  
  Args:
    policy: A TF Policy implementing `tf_policy.TFPolicy`.
    batch_size: (deprecated)
    seed: Seed to use if policy performs random actions (optional).
docstr_tok: ["Initializes","a","new","`","PyTFPolicy","`",".","Args",":","policy",":","A","TF","Policy","implementing","`","tf_policy.TFPolicy","`",".","batch_size",":","(","deprecated",")","seed",":","Seed","to","use","if","policy","performs","random","actions","(","optional",")","."]
code: def __init__(
      self,
      policy: tf_policy.TFPolicy,
      batch_size: Optional[int] = None,
      seed: Optional[types.Seed] = None,
  ):
      """Initializes a new `PyTFPolicy`.
  
      Args:
        policy: A TF Policy implementing `tf_policy.TFPolicy`.
        batch_size: (deprecated)
        seed: Seed to use if policy performs random actions (optional).
      """
      if not isinstance(policy, tf_policy.TFPolicy):
          logging.warning("Policy should implement tf_policy.TFPolicy")
  
      if batch_size is not None:
          logging.warning(
              "In PyTFPolicy constructor, `batch_size` is deprecated, "
              "this parameter has no effect. This argument will be "
              "removed on 2019-05-01"
          )
  
      time_step_spec = tensor_spec.to_nest_array_spec(
          policy.time_step_spec
      )
      action_spec = tensor_spec.to_nest_array_spec(policy.action_spec)
      super(PyTFPolicy, self).__init__(
          time_step_spec,
          action_spec,
          policy_state_spec=(),
          info_spec=(),
      )
  
      self._tf_policy = policy
      self.session: tf.compat.v1.Session = None
  
      self._policy_state_spec = tensor_spec.to_nest_array_spec(
          self._tf_policy.policy_state_spec
      )
  
      self._batch_size = None
      self._batched = None
      self._seed = seed
      self._built = False
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from typing import Optional, Text
  from absl import logging
  import tensorflow
  from tf_agents.policies import py_policy
  from tf_agents.policies import tf_policy
  from tf_agents.specs import tensor_spec
  from tf_agents.trajectories import policy_step
  from tf_agents.trajectories import time_step
  from tf_agents.typing import types
  from tf_agents.utils import common
  from tf_agents.utils import nest_utils
  from tf_agents.utils import session_utils
label_desc: Use image node_id 1 to create a new PyTFPolicy object from inherited base classes: py_policy, session_utils with example: obj = PyTFPolicy(policy, batch_size, seed)