code: def _compareTwoMethodsCompilerIROutput(self, f, args, kwargs):
      flat_args = list(args) + list(kwargs.values())
      if not all([isinstance(x, tensor.Tensor) for x in flat_args]):
          self.skipTest(
              "It only support args and kwargs are all tf.Tensor types."
          )
  
      args_spec = nest.map_structure(
          tensor.TensorSpec.from_tensor, args
      )
      kwargs_spec = nest.map_structure(
          tensor.TensorSpec.from_tensor, kwargs
      )
  
      hlo_1 = f.experimental_get_compiler_ir(*args, **kwargs)()
      hlo_2 = f.experimental_get_compiler_ir(
          *args_spec, **kwargs_spec
      )()
  
      if hlo_1 != hlo_2:
          self.fail(
              "The tensor_spec way experimental_get_compiler_ir give diff result"
              " to normal experimental_get_compiler_ir."
              f" \nhlo(concrete_input):\n{hlo_1}\nhlo(tensor_spec):\n{hlo_2}\n"
          )
  
imports: from tensorflow.compiler.tests import xla_test
  from tensorflow.python.eager.polymorphic_function import compiler_ir
  from tensorflow.python.eager.polymorphic_function import polymorphic_function
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import gen_array_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import variables
  from tensorflow.python.platform import test
  from tensorflow.python.util import nest
label_desc: Use image node_id 1 for calling the CompilerIrTest obj's underlying member method code with example usage: obj._compareTwoMethodsCompilerIROutput(f, args, kwargs) without return types