class_docstr: Relative Entropy Policy Search.
  
  References
  ----------
  [1] J. Peters, K. Mulling, and Y. Altun, "Relative Entropy Policy Search,"
      Artif. Intell., pp. 1607-1612, 2008.
  
  Example:
      $ python garage/examples/tf/reps_gym_cartpole.py
  
  Args:
      env_spec (EnvSpec): Environment specification.
      policy (garage.tf.policies.StochasticPolicy): Policy.
      baseline (garage.tf.baselines.Baseline): The baseline.
      sampler (garage.sampler.Sampler): Sampler.
      scope (str): Scope for identifying the algorithm.
          Must be specified if running multiple algorithms
          simultaneously, each using different environments
          and policies.
      discount (float): Discount.
      gae_lambda (float): Lambda used for generalized advantage
          estimation.
      center_adv (bool): Whether to rescale the advantages
          so that they have mean 0 and standard deviation 1.
      positive_adv (bool): Whether to shift the advantages
          so that they are always positive. When used in
          conjunction with center_adv the advantages will be
          standardized before shifting.
      fixed_horizon (bool): Whether to fix horizon.
      epsilon (float): Dual func parameter.
      l2_reg_dual (float): Coefficient for dual func l2 regularization.
      l2_reg_loss (float): Coefficient for policy loss l2 regularization.
      optimizer (object): The optimizer of the algorithm. Should be the
          optimizers in garage.tf.optimizers.
      optimizer_args (dict): Arguments of the optimizer.
      dual_optimizer (object): Dual func optimizer.
      dual_optimizer_args (dict): Arguments of the dual optimizer.
      name (str): Name of the algorithm.
docstr: Build input variables.
  
  Returns:
      namedtuple: Collection of variables to compute policy loss.
      namedtuple: Collection of variables to do policy optimization.
docstr_tok: ["Build","input","variables",".","Returns",":","namedtuple",":","Collection","of","variables","to","compute","policy","loss",".","namedtuple",":","Collection","of","variables","to","do","policy","optimization","."]
code: def _build_inputs(self):
      """Build input variables.
  
      Returns:
          namedtuple: Collection of variables to compute policy loss.
          namedtuple: Collection of variables to do policy optimization.
  
      """
      observation_space = self.policy.observation_space
      action_space = self.policy.action_space
  
      with tf.name_scope("inputs"):
          obs_var = observation_space.to_tf_placeholder(
              name="obs", batch_dims=2
          )
          action_var = action_space.to_tf_placeholder(
              name="action", batch_dims=2
          )
          reward_var = new_tensor(
              name="reward", ndim=2, dtype=tf.float32
          )
          valid_var = new_tensor(name="valid", ndim=2, dtype=tf.float32)
          feat_diff = new_tensor(
              name="feat_diff", ndim=2, dtype=tf.float32
          )
          param_v = new_tensor(name="param_v", ndim=1, dtype=tf.float32)
          param_eta = new_tensor(
              name="param_eta", ndim=0, dtype=tf.float32
          )
          policy_state_info_vars = {
              k: tf.compat.v1.placeholder(
                  tf.float32, shape=[None] * 2 + list(shape), name=k
              )
              for k, shape in self.policy.state_info_specs
          }
          policy_state_info_vars_list = [
              policy_state_info_vars[k]
              for k in self.policy.state_info_keys
          ]
  
      self._policy_network = self.policy.build(obs_var, name="policy")
      self._old_policy_network = self._old_policy.build(
          obs_var, name="policy"
      )
  
      policy_loss_inputs = graph_inputs(
          "PolicyLossInputs",
          obs_var=obs_var,
          action_var=action_var,
          reward_var=reward_var,
          valid_var=valid_var,
          feat_diff=feat_diff,
          param_eta=param_eta,
          param_v=param_v,
          policy_state_info_vars=policy_state_info_vars,
      )
      policy_opt_inputs = graph_inputs(
          "PolicyOptInputs",
          obs_var=obs_var,
          action_var=action_var,
          reward_var=reward_var,
          valid_var=valid_var,
          feat_diff=feat_diff,
          param_eta=param_eta,
          param_v=param_v,
          policy_state_info_vars_list=policy_state_info_vars_list,
      )
      dual_opt_inputs = graph_inputs(
          "DualOptInputs",
          reward_var=reward_var,
          valid_var=valid_var,
          feat_diff=feat_diff,
          param_eta=param_eta,
          param_v=param_v,
          policy_state_info_vars_list=policy_state_info_vars_list,
      )
  
      return policy_loss_inputs, policy_opt_inputs, dual_opt_inputs
  
imports: import collections
  from dowel import logger, tabular
  import numpy
  import scipy.optimize
  import tensorflow
  from garage import _Default, log_performance, make_optimizer
  from garage.np import pad_batch_array
  from garage.np.algos import RLAlgorithm
  from garage.tf import compile_function, flatten_inputs, graph_inputs, new_tensor
  from garage.tf.optimizers import LBFGSOptimizer
label_desc: Use image node_id 8 for calling the REPS obj's underlying member method code with example usage: obj._build_inputs() and returns: policy_loss_inputs,  policy_opt_inputs,  dual_opt_inputs