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: Construct the agent graph through placeholders.
docstr_tok: ["Construct","the","agent","graph","through","placeholders","."]
code: def _construct(self, batch_size, graph):
      """Construct the agent graph through placeholders."""
  
      self._batch_size = batch_size
      self._batched = batch_size is not None
  
      outer_dims = [self._batch_size] if self._batched else [1]
      with graph.as_default():
          self._time_step = tensor_spec.to_nest_placeholder(
              self._tf_policy.time_step_spec, outer_dims=outer_dims
          )
          self._tf_initial_state = self._tf_policy.get_initial_state(
              batch_size=self._batch_size or 1
          )
  
          self._policy_state = tf.nest.map_structure(
              lambda ps: tf.compat.v1.placeholder(  # pylint: disable=g-long-lambda
                  ps.dtype, ps.shape, name="policy_state"
              ),
              self._tf_initial_state,
          )
          self._action_step = self._tf_policy.action(
              self._time_step, self._policy_state, seed=self._seed
          )
  
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 2 for calling the PyTFPolicy obj's underlying member method code with example usage: obj._construct(batch_size, graph) without return types