code: def test_compile_on_demand(self):
      if (
          not test.is_gpu_available()
          or not test.is_built_with_gpu_support()
      ):
          test.skipTest("Test only applicable on GPU")
  
      with ops.device("/device:XLA_GPU:0"):
          a = constant_op.constant([1.0, 2.0])
          b = constant_op.constant([2.0, 3.0])
          c = a + b
          self.assertAllClose([3.0, 5.0], c, atol=1e-05)
  
          v = variables.Variable([0.0, 1.0])
          v.assign([1.0, 2.0])
          self.assertAllClose([1.0, 2.0], v.value(), atol=1e-05)
          v.assign_add([1.0, 2.0])
          self.assertAllClose([2.0, 4.0], v.value(), atol=1e-05)
  
          d = c + v
          self.assertAllClose([5.0, 9.0], d, atol=1e-05)
  
file_path: tensorflow/tensorflow/python/compiler/xla/tests/pjrt_compile_test.py
imports: import numpy
  from tensorflow.python.eager import def_function
  from tensorflow.python.eager import test
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import variables
label_desc: Use image node_id 1 for calling the PjrtCompileTest obj's underlying member method code with example usage: obj.test_compile_on_demand() without return types