'Train policy using trust region step.'

def trust_region_step(self, sess, observations, internal_state, actions, rewards, terminated, pads, avg_episode_reward=0):

    feed_dict = {self.internal_state: internal_state, self.rewards: rewards, self.terminated: terminated, self.pads: pads, self.avg_episode_reward: avg_episode_reward}
    for (action_place, action) in zip(self.actions, actions):
        feed_dict[action_place] = action
    for (obs_place, obs) in zip(self.observations, observations):
        feed_dict[obs_place] = obs
    (prev_log_probs, prev_logits) = sess.run([self.out_log_probs, self.logits], feed_dict=feed_dict)
    feed_dict[self.prev_log_probs] = prev_log_probs
    for (other_logit, prev_logit) in zip(self.other_logits, prev_logits):
        feed_dict[other_logit] = prev_logit
    self.trust_region_policy_opt.optimize(sess, feed_dict)
    ret = sess.run([self.raw_loss, self.summary], feed_dict=feed_dict)
    ret = [ret[0], None, ret[1]]
    return ret
