code: def test_while_force_unstacked_condition(self):
      # The while_loop in this setup is similar to the one in test_stateless_while
      # whose condition is loop variant. However here we wrap the cond and body of
      # the loop in a way that makes the while_loop condition pfor loop invariant.
      # This allows xla compilation to work since the vectorized code no longer
      # needs to perform dynamic partitioning of the inputs.
      x = random_ops.random_uniform([3, 5])
      lengths = constant_op.constant([4, 0, 2])
  
      def loop_fn(i, pfor_config):
          x_i = array_ops.gather(x, i)
          lengths_i = array_ops.gather(lengths, i)
  
          def _cond(j, _):
              return j < lengths_i
  
          def _body(j, t):
              return (j + 1, t + array_ops.gather(x_i, j))
  
          cond, body = _make_unstacked(_cond, _body, pfor_config)
          return while_loop.while_loop(cond, body, [True, 0, 0.0])
  
      self._test_loop_fn(loop_fn, 3, force_xla=True)
  
imports: from tensorflow.compiler.tf2xla.python import xla
  from tensorflow.python.compiler.xla import jit
  from tensorflow.python.compiler.xla import xla
  from tensorflow.python.eager import context
  from tensorflow.python.eager import def_function
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import control_flow_v2_toggles
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import random_ops
  from tensorflow.python.ops import resource_variable_ops
  from tensorflow.python.ops import while_loop
  from tensorflow.python.ops.parallel_for import control_flow_ops
  from tensorflow.python.ops.parallel_for.test_util import PForTestCase
  from tensorflow.python.platform import test
label_desc: Use image node_id 7 for calling the WhileV2Test obj's underlying member method code with example usage: obj.test_while_force_unstacked_condition() and returns: while_loop, unknown, unknown,  unknown