code: def _compare(
      self,
      fn,
      args,
      require_kernel_launch=True,
      name=None,
      noinline=None,
  ):
      with session_lib.Session(config=NoRewriteSessionConfig()) as sess:
          placeholders = []
          feeds = {}
          for arg in args:
              placeholder = array_ops.placeholder(
                  dtypes.as_dtype(arg.dtype), list(arg.shape)
              )
              placeholders.append(placeholder)
              feeds[placeholder] = arg
  
          compiled_op = CompiledKernel(
              fn, *placeholders, name=name, noinline=noinline
          )
          direct_op = fn(*placeholders)
  
          run_metadata = config_pb2.RunMetadata()
          compiled = test_utils.RunWithWarmup(
              sess,
              compiled_op,
              feeds,
              config_pb2.RunOptions(
                  trace_level=config_pb2.RunOptions.FULL_TRACE
              ),
              run_metadata,
          )
          print("Compiled Result {}".format(compiled))
  
          if require_kernel_launch:
              self.assertTrue(MetadataHasXlaRunOp(run_metadata))
  
              direct = sess.run(direct_op, feeds)
              print("Direct Result {}".format(direct))
  
              if isinstance(compiled, (tuple, list)) and (
                  isinstance(direct, (tuple, list))
              ):
                  for x, y in zip(compiled, direct):
                      self.assertAllClose(x, y, rtol=1e-1)
              else:
                  self.assertAllClose(compiled, direct, rtol=1e-2)
  
imports: import os
  import numpy
  from tensorflow.compiler.tests import test_utils
  from tensorflow.core.protobuf import config_pb2
  from tensorflow.core.protobuf import rewriter_config_pb2
  from tensorflow.python.client import session
  from tensorflow.python.compiler.xla import jit
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import function
  from tensorflow.python.framework import ops
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import cond
  from tensorflow.python.ops import control_flow_ops
  from tensorflow.python.ops import gradients_impl
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import nn_ops
  from tensorflow.python.ops import while_loop
  from tensorflow.python.platform import test
label_desc: Use image node_id 1 for calling the JitLaunchTest obj's underlying member method code with example usage: obj._compare(fn, args, require_kernel_launch, name, noinline) without return types