class_docstr: trpo class
class_docstr_tok: ["trpo","class"]
docstr: calculate kl-divergence
  :param states: state batch
  :param old_mean: mean batch of the old pi
  :param old_log_std: log std batch of the old pi
  :return: kl_mean or None
docstr_tok: ["calculate","kl-divergence",":","param","states",":","state","batch",":","param","old_mean",":","mean","batch","of","the","old","pi",":","param","old_log_std",":","log","std","batch","of","the","old","pi",":","return",":","kl_mean","or","None"]
code: def kl(self, states, old_mean, old_log_std):
      """
      calculate kl-divergence
      :param states: state batch
      :param old_mean: mean batch of the old pi
      :param old_log_std: log std batch of the old pi
      :return: kl_mean or None
      """
      old_mean = old_mean[:, np.newaxis]
      old_log_std = old_log_std[:, np.newaxis]
      old_std = tf.exp(old_log_std)
      old_pi = tfp.distributions.Normal(old_mean, old_std)
  
      mean = self.actor(states)
      std = tf.exp(self.actor.log_std) * tf.ones_like(mean)
      pi = tfp.distributions.Normal(mean, std)
  
      kl = tfp.distributions.kl_divergence(pi, old_pi)
      all_kls = tf.reduce_sum(kl, axis=1)
      return tf.reduce_mean(all_kls)
  
imports: import argparse
  import copy
  import os
  import threading
  import time
  import gym
  import matplotlib.pyplot
  import numpy
  import scipy.signal
  import tensorflow
  import tensorflow_probability
  import tensorlayer
label_desc: Use image node_id 6 for calling the TRPO obj's underlying member method code with example usage: obj.kl(states, old_mean, old_log_std) and returns: tf