docstr: Tests that update function works in batching mode.
docstr_tok: ["Tests","that","update","function","works","in","batching","mode","."]
code: def test_update_batching_vs_mapping(self):
      """Tests that update function works in batching mode."""
      wolfe_threshold = 1e-6
      x = np.array([0.0, 0.6, 1.0])
      ys = np.array([[1.0, 1.2, 1.1], [1.0, 0.9, 1.2]])
      dys = np.array([[-0.8, 0.6, 0.6], [-0.8, -0.7, 0.6]])
  
      # Create each individual and batched functions.
      fun1 = _test_function_x_y_dy(x, ys[0], dys[0])
      fun2 = _test_function_x_y_dy(x, ys[1], dys[1])
      funs = _test_function_x_y_dy(x, ys, dys)
  
      def eval_update(fun):
          val_a = fun(0.0)
          val_b = fun(1.0)
          val_trial = fun(0.6)
          f_lim = val_a.f + (wolfe_threshold * tf.abs(val_a.f))
          return self.evaluate(
              hzl.update(fun, val_a, val_b, val_trial, f_lim)
          )
  
      result1 = eval_update(fun1)
      result2 = eval_update(fun2)
      results = eval_update(funs)
  
      # Both batching/non-batching versions get the same result.
      self.assertEqual(result1.left.x, results.left.x[0])
      self.assertEqual(result1.right.x, results.right.x[0])
      self.assertEqual(result2.left.x, results.left.x[1])
      self.assertEqual(result2.right.x, results.right.x[1])
  
imports: import collections
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.math.gradient import value_and_gradient
  from tensorflow_probability.python.optimizer.linesearch.internal import hager_zhang_lib
label_desc: Use image node_id 4 for calling the HagerZhangLibTest obj's underlying member method code with example usage: obj.test_update_batching_vs_mapping() and returns: self