code: def testSwitchCaseConstPropagation(self):
      self.skipTest("b/127846988")
      with self.session() as sess, self.test_scope():
          xla_context = control_flow_ops.XLAControlFlowContext()
          xla_context.Enter()
  
          x = array_ops.placeholder(dtypes.float32)
          p = array_ops.placeholder(dtypes.int32)
  
          def branch0():
              return 5.0
  
          def branch1():
              return 15.0
  
          # TODO(b/129021699): Wrapping this in a tf.function does not work.
          def branch2():
              # This emits a StridedSlice op which expects the index to be a
              # compile-time const.
              return x[p]
  
          output = control_flow_switch_case.switch_case(
              constant_op.constant(2),
              {
                  0: branch0,
                  1: branch1,
                  2: branch2,
              },
          )
  
          self.assertAllEqual(
              7.0,
              sess.run(
                  output,
                  feed_dict={
                      x: [0.0, 1.0, 7.0],
                      p: 2,
                  },
              ),
          )
  
          xla_context.Exit()
  
imports: from tensorflow.compiler.tests import xla_test
  from tensorflow.python.client import session
  from tensorflow.python.compiler.xla import xla
  from tensorflow.python.eager import def_function
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import errors
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import test_util
  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 control_flow_switch_case
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import random_ops
  from tensorflow.python.ops import tensor_array_ops
  from tensorflow.python.platform import test
label_desc: Use image node_id 10 for calling the CondTest obj's underlying member method code with example usage: obj.testSwitchCaseConstPropagation() and returns: int, int, x