code: def compute_hessian(f, params):
      h = []
      for i in params:
          h_i = []
          for j in params:
              h_ij = tf.gradients(tf.gradients(f, j)[0], i)[0]
              h_ij = [0.0] if h_ij is None else h_ij
              h_i.append(h_ij)
          h_i = tf.convert_to_tensor(h_i)
          h.append(h_i)
      h = tf.convert_to_tensor(h)
      h = tf.reshape(h, (len(params), len(params)))
      return h
  
imports: import pickle
  import numpy
  import pytest
  import tensorflow
  from garage.tf.models import Module
  from garage.tf.optimizers.conjugate_gradient_optimizer import ConjugateGradientOptimizer
  from garage.tf.optimizers.conjugate_gradient_optimizer import FiniteDifferenceHVP
  from garage.tf.optimizers.conjugate_gradient_optimizer import _cg, PearlmutterHVP
  from garage.tf.policies import Policy
  from tests.fixtures import TfGraphTestCase
label_desc: Use image node_id 1 for calling a global function with example usage: compute_hessian(f, params) and returns: h