class_docstr: Tests for Nelder-Mead optimization algorithm.
class_docstr_tok: ["Tests","for","Nelder-Mead","optimization","algorithm","."]
docstr: Tests XLA compilation.
docstr_tok: ["Tests","XLA","compilation","."]
code: def test_rosenbrock_2d_compiled(self):
      """Tests XLA compilation."""
      self.skip_if_no_xla()
  
      def rosenbrock(coord):
          x, y = coord[0], coord[1]
          fv = (1 - x) ** 2 + 100 * (y - x**2) ** 2
          return tf.cast(fv, x.dtype)
  
      start = tf.constant([-1.0, 1.0])
      results = tf.function(nelder_mead.minimize, jit_compile=True)(
          rosenbrock,
          initial_vertex=start,
          func_tolerance=1e-12,
          batch_evaluate_objective=False,
      )
      results = self.evaluate(results)
      self.assertTrue(results.converged)
      self.assertArrayNear(results.position, [1.0, 1.0], 1e-5)
  
imports: import numpy
  from scipy.stats import special_ortho_group
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.optimizer import nelder_mead
label_desc: Use image node_id 10 for calling the NelderMeadTest obj's underlying member method code with example usage: obj.test_rosenbrock_2d_compiled() and returns: tf