class_docstr: Test that jit_compile=True correctly throws an exception if XLA is not available.
  
  This test should only be run without `--config=cuda`, as that implicitly links
  in XLA JIT.
code: def testJitCompileRaisesExceptionWhenXlaIsUnsupported(self):
      if test.is_built_with_rocm() or test_util.is_xla_enabled():
          return
  
      with self.assertRaisesRegex(
          errors.UnimplementedError,
          "support for that platform linked in",
      ):
  
          @polymorphic_function.function(jit_compile=True)
          def fn(x):
              return x + x
  
          fn([1, 1, 2, 3])
  
file_path: tensorflow-upstream/tensorflow/python/eager/polymorphic_function/polymorphic_function_test_cpu_only.py
imports: from absl.testing import parameterized
  from tensorflow.python.eager.polymorphic_function import polymorphic_function
  from tensorflow.python.framework import errors
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import test_util
  from tensorflow.python.platform import test
label_desc: Use image node_id 1 for calling the FunctionCpuOnlyTest obj's underlying member method code with example usage: obj.testJitCompileRaisesExceptionWhenXlaIsUnsupported() and returns: unknown