code: def _do_policy_eval(tf_sess, to_eval, policies, active_episodes):
      
  
      eval_results = {}
  
      if tf_sess:
          builder = TFRunBuilder(tf_sess, "policy_eval")
          pending_fetches = {}
      else:
          builder = None
  
      if log_once("compute_actions_input"):
          logger.info("Inputs to compute_actions():\n\n{}\n".format(
              summarize(to_eval)))
  
      for policy_id, eval_data in to_eval.items():
          rnn_in_cols = _to_column_format([t.rnn_state for t in eval_data])
          policy = _get_or_raise(policies, policy_id)
          if builder and (policy.compute_actions.__code__ is
                          TFPolicyGraph.compute_actions.__code__):
              # TODO(ekl): how can we make info batch available to TF code?
              pending_fetches[policy_id] = policy._build_compute_actions(
                  builder, [t.obs for t in eval_data],
                  rnn_in_cols,
                  prev_action_batch=[t.prev_action for t in eval_data],
                  prev_reward_batch=[t.prev_reward for t in eval_data])
          else:
              eval_results[policy_id] = policy.compute_actions(
                  [t.obs for t in eval_data],
                  rnn_in_cols,
                  prev_action_batch=[t.prev_action for t in eval_data],
                  prev_reward_batch=[t.prev_reward for t in eval_data],
                  info_batch=[t.info for t in eval_data],
                  episodes=[active_episodes[t.env_id] for t in eval_data])
      if builder:
          for k, v in pending_fetches.items():
              eval_results[k] = builder.get(v)
  
      if log_once("compute_actions_result"):
          logger.info("Outputs of compute_actions():\n\n{}\n".format(
              summarize(eval_results)))
  
      return eval_results
docs: Call compute actions on observation batches to get next actions.
  
      Returns:
          eval_results: dict of policy to compute_action() outputs.