code: def test_vmap_of_while_loop_should_transform_name_stack(self):
      @jax.vmap
      @jax.named_scope("foo")
      def f(x):
          @jax.named_scope("bar")
          def body(x):
              return x + 1
  
          @jax.named_scope("bar_cond")
          def cond(x):
              return x < 5
  
          return lax.while_loop(cond, body, x)
  
      jaxpr = jax.make_jaxpr(f)(jnp.arange(2))
      self.assertEqual(
          str(jaxpr.eqns[0].source_info.name_stack), "vmap(foo)"
      )
      self.assertEqual(
          str(
              jaxpr.eqns[0]
              .params["body_jaxpr"]
              .eqns[0]
              .source_info.name_stack
          ),
          "bar",
      )
      self.assertEqual(
          str(
              jaxpr.eqns[0]
              .params["cond_jaxpr"]
              .eqns[0]
              .source_info.name_stack
          ),
          "bar_cond",
      )
  
      hlo_text = _get_hlo(f)(jnp.arange(2.0))
      self.assertIn("vmap(foo)/while/body/bar/add", hlo_text)
      self.assertIn("vmap(foo)/while/cond/bar_cond/lt", hlo_text)
  
imports: import functools
  from absl.testing import absltest
  import jax
  import jax.numpy
  from jax._src import core
  from jax import lax
  from jax._src.pjit import pjit
  from jax._src import linear_util
  from jax import config
  from jax._src import test_util
  from jax._src.lib import xla_client
label_desc: Use image node_id 2 for calling the NameStackControlFlowTest obj's underlying member method code with example usage: obj.test_vmap_of_while_loop_should_transform_name_stack() and returns: lax, unknown, unknown