code: def test_jit_compile_applies_xla_context(self):
      if tf.config.functions_run_eagerly():
          self.skipTest(
              "XLA test does not make sense without tf.function"
          )
  
      x = tf.Variable(0.0)
      opt = _get_sgd_optimizer(0.1)
  
      # Define a 'loss' that returns a constant value indicating
      # whether it is executing in an XLA context.
      using_xla, not_using_xla = 42.0, -9999.0
  
      def xla_detecting_loss_fn():
          # Search the graph hierarchy for an XLA context.
          graph = tf1.get_default_graph()
          while True:
              if (
                  graph._control_flow_context is not None
                  and graph._control_flow_context.IsXLAContext()
              ):
                  return using_xla + (
                      x - x
                  )  # Refer to `x` to ensure gradient.
              try:
                  graph = graph.outer_graph
              except AttributeError:
                  break
          return not_using_xla + (x - x)
  
      xla_losses = minimize(
          loss_fn=xla_detecting_loss_fn,
          num_steps=1,
          optimizer=opt,
          jit_compile=True,
      )
      self.evaluate(tf1.global_variables_initializer())
      self.assertAllClose(xla_losses, [using_xla])
  
      non_xla_losses = minimize(
          loss_fn=xla_detecting_loss_fn,
          num_steps=1,
          optimizer=opt,
          jit_compile=False,
      )
      self.assertAllClose(non_xla_losses, [not_using_xla])
  
imports: import collections
  import numpy
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python import optimizer
  from tensorflow_probability.python.distributions import normal
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.internal import tf_keras
  from tensorflow_probability.python.math.minimize import minimize
  from tensorflow_probability.python.math.minimize import minimize_stateless
label_desc: Use image node_id 10 for calling the MinimizeTests obj's underlying member method code with example usage: obj.test_jit_compile_applies_xla_context() and returns: unknown, unknown