class_docstr: trpo class
class_docstr_tok: ["trpo","class"]
docstr: calculate Hessian-vector product
  :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: hvp
docstr_tok: ["calculate","Hessian-vector","product",":","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",":","hvp"]
code: def hvp(self, states, old_mean, old_log_std, x):
      """
      calculate Hessian-vector product
      :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: hvp
      """
      pi_params = self.actor.trainable_weights
      with tf.GradientTape() as tape1:
          with tf.GradientTape() as tape0:
              d_kl = self.kl(states, old_mean, old_log_std)
          g = self._flat_concat(tape0.gradient(d_kl, pi_params))
          l = tf.reduce_sum(g * x)
      hvp = self._flat_concat(tape1.gradient(l, pi_params))
  
      if DAMPING_COEFF > 0:
          hvp += DAMPING_COEFF * x
      return hvp
  
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 13 for calling the TRPO obj's underlying member method code with example usage: obj.hvp(states, old_mean, old_log_std, x) and returns: hvp