code: def compile(
      computation, inputs=None
  ):  # pylint: disable=redefined-builtin
      """Builds an operator that compiles and runs `computation` with XLA.
  
      NOTE: In eager mode, `computation` will have `@tf.function` semantics.
  
      Args:
        computation: A Python function that builds a computation to apply to the
          input. If the function takes n inputs, 'inputs' should be a list of n
          `Tensor`s.
  
          `computation` may return a list of `Tensor`s and `Operation`s.
          `Tensor`s must come before `Operation`s in the returned list.
  
          All `Operation`s returned from `computation` will be executed when
          evaluating any of the returned output tensors.
        inputs: A list of inputs or `None` (equivalent to an empty list). Each input
          can be a nested structure containing values that can be converted to
          `Tensor`s. Note that passing an N-dimension list of compatible values will
          result in an N-dimension list of scalar `Tensor`s rather than a single
          Rank-N `Tensor`. If you need a different behavior, convert parts of
          `inputs` to `Tensor`s with `tf.convert_to_tensor`.
  
      Returns:
        List of `Tensor`s corresponding to the `Tensor`s from
          the output of `computation` i.e. the same return value as if
          computation(*inputs) is called directly, with the following exceptions:
          * None output: a NoOp would be returned with a control dependency on
             `computation`.
          * Single value output: a tuple containing the value would be returned.
          * Operation-only outputs: a NoOp would be returned with a control
          dependency on `computation`.
          TODO(b/121383831): Investigate into removing these special cases.
  
      Raises:
        RuntimeError: When eager execution is enabled.
  
      Known issues:
        When a tf.random operation is built with XLA, the implementation doesn't
          pass the user provided seed to the XLA compiler. As such, the XLA compiler
          generates a random number and uses it as a seed when compiling the
          operation. This implementation causes a violation of the Tensorflow
          defined semantics in two aspects. First, changing the value of the user
          defined seed doesn't change the numbers generated by the operation.
          Second, when a seed is not specified, running the program multiple times
          will generate the same numbers.
      """
      if context.executing_eagerly():
  
          @def_function.function
          def xla_compile_wrapper():
              return _compile_internal(computation, inputs)
  
          return xla_compile_wrapper()
  
      return _compile_internal(computation, inputs)
  
imports: import contextlib
  from tensorflow.compiler.jit.ops import xla_ops
  from tensorflow.compiler.jit.ops import xla_ops_grad
  from tensorflow.core.framework import attr_value_pb2
  from tensorflow.python.distribute import summary_op_util
  from tensorflow.python.eager import context
  from tensorflow.python.eager import def_function
  from tensorflow.python.framework import ops
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import control_flow_ops
  from tensorflow.python.ops import variable_scope
  from tensorflow.python.platform import tf_logging
  from tensorflow.python.util import compat
  from tensorflow.python.util import nest
  from tensorflow.python.util import tf_inspect
  from tensorflow.python.util.compat import collections_abc
  from tensorflow.python.util.deprecation import deprecated
  from tensorflow.python.util.tf_export import tf_export
label_desc: Use image node_id 1 for calling a global function with example usage: compile(computation, inputs) and returns: _compile_internal, xla_compile_wrapper, _compile_internal