class_docstr: Tests for Hager Zhang line search algorithm.
class_docstr_tok: ["Tests","for","Hager","Zhang","line","search","algorithm","."]
code: def test_quadratic(self, start):
      fdf = lambda x: ValueAndGradient(
          x=x, f=(x - 1.3) ** 2, df=2 * (x - 1.3)
      )
  
      start = tf.constant(start)
      results = self.evaluate(hager_zhang(fdf, initial_step_size=start))
      self.assertTrue(results.converged)
      self.assertAlmostEqual(results.left.x, results.right.x)
      val_0 = fdf(0.0)
      self.assertTrue(
          _is_exact_wolfe(
              results.left.x,
              results.left.f,
              results.left.df,
              val_0.f,
              val_0.df,
              0.1,
              0.9,
          )
      )
  
imports: import collections
  from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.optimizer.linesearch.hager_zhang import hager_zhang
label_desc: Use image node_id 1 for calling the HagerZhangTest obj's underlying member method code with example usage: obj.test_quadratic(start) without return types