code: def testIfWithFunction(self):
      @def_function.function(
          input_signature=[tensor_spec.TensorSpec((), dtypes.float32)]
      )
      def Then(x):
          return x + 1
  
      @def_function.function(
          input_signature=[tensor_spec.TensorSpec((), dtypes.float32)]
      )
      def Else(x):
          return x - 1
  
      inputs = [10.0]
      then_cf = Then.get_concrete_function()
      else_cf = Else.get_concrete_function()
      result = self.evaluate(
          functional_ops.If(False, inputs, then_cf, else_cf)
      )
      self.assertEqual([9.0], result)
  
file_path: tensorflow/tensorflow/python/ops/functional_ops_test.py
imports: from tensorflow.python.eager import def_function
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import function
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import sparse_tensor
  from tensorflow.python.framework import tensor_spec
  from tensorflow.python.ops import functional_ops
  from tensorflow.python.platform import test
label_desc: Use image node_id 2 for calling the FunctionalOpsTest obj's underlying member method code with example usage: obj.testIfWithFunction() and returns: unknown, unknown