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","."]
code: def initialize(
      self, batch_size: Optional[int], graph: Optional[tf.Graph] = None
  ):
      if self._built:
          raise RuntimeError("PyTFPolicy can only be initialized once.")
  
      if not graph:
          graph = tf.compat.v1.get_default_graph()
  
      self._construct(batch_size, graph)
      var_list = tf.nest.flatten(self._tf_policy.variables())
      common.initialize_uninitialized_variables(self.session, var_list)
      self._built = True
  
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 3 for calling the PyTFPolicy obj's underlying member method code with example usage: obj.initialize(batch_size, graph) without return types