docstr: Test several ways of customizing the compilation attribute.
docstr_tok: ["Test","several","ways","of","customizing","the","compilation","attribute","."]
code: def testJITCreateOpsLambda(self):
      """Test several ways of customizing the compilation attribute."""
  
      def create_ops():
          with variable_scope.variable_scope(
              "root",
              initializer=init_ops.random_uniform_initializer(
                  -0.1, 0.1, seed=2
              ),
          ):
              inputs = random_ops.random_uniform(
                  (1,), minval=-10, maxval=10, seed=1
              )
              return inputs
  
      v_false_1_t, v_false_1 = self.compute(False, create_ops)
      _, v_false_2 = self.compute(False, create_ops)
      v_true_1_t, v_true_1 = self.compute(
          enable_jit_nonstateful, create_ops
      )
      _, v_true_2 = self.compute(enable_jit_nonstateful, create_ops)
      v_all_true_t, _ = self.compute(True, create_ops)
      self.assertFalse(v_false_1_t.op.get_attr("_XlaCompile"))
      v_true_1_t_sampler_op = v_true_1_t.graph.get_operation_by_name(
          "root/random_uniform/RandomUniform"
      )
      v_all_true_t_sampler_op = (
          v_all_true_t.graph.get_operation_by_name(
              "root/random_uniform/RandomUniform"
          )
      )
  
      self.assertFalse(v_true_1_t_sampler_op.get_attr("_XlaCompile"))
      self.assertTrue(v_all_true_t_sampler_op.get_attr("_XlaCompile"))
  
      self.assertTrue(v_true_1_t.op.get_attr("_XlaCompile"))
      self.assertTrue(v_all_true_t.op.get_attr("_XlaCompile"))
  
      # Additionally ensure that where no JIT compilation happens on the
      # random_uniform op, the output values are identical to the case
      # where no JIT compilation happens anywhere.
      self.assertAllClose(v_false_1, v_false_2)
      self.assertAllClose(v_true_1, v_true_2)
      self.assertAllClose(v_false_1, v_true_1)
  
imports: from absl.testing import parameterized
  from tensorflow.python.compiler.xla import jit
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import function
  from tensorflow.python.framework import op_def_registry
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import random_seed
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import gradients
  from tensorflow.python.ops import init_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import random_ops
  from tensorflow.python.ops import variable_scope
  from tensorflow.python.ops import variables
  from tensorflow.python.platform import test
label_desc: Use image node_id 3 for calling the JITTest obj's underlying member method code with example usage: obj.testJITCreateOpsLambda() and returns: inputs