class_docstr: Tests jit targeting to different backends.
class_docstr_tok: ["Tests","jit","targeting","to","different","backends","."]
code: def testMultiBackendNestedJitConflict(self, ordering):
      outer, inner = ordering
      if outer not in ("cpu", jtu.device_under_test(), None):
          raise SkipTest("Backend is not CPU or the device under test")
      if inner not in ("cpu", jtu.device_under_test(), None):
          raise SkipTest("Backend is not CPU or the device under test")
      if outer is None and inner == jtu.device_under_test():
          raise SkipTest("(None, device) is allowed")
      if outer is None:
          raise SkipTest(
              "The inner device will dictate the device assignment for "
              "the entire computation. So if inner is CPU and outer is "
              "None, then the computation will be execute on CPU."
          )
  
      @partial(jax.jit, backend=outer)
      def fun(x, y):
          @partial(jax.jit, backend=inner)
          def infun(x, y):
              return jnp.matmul(x, y)
  
          return infun(x, y) + jnp.ones_like(x)
  
      x = npr.uniform(size=(10, 10))
      y = npr.uniform(size=(10, 10))
      self.assertRaises(ValueError, lambda: fun(x, y))
  
file_path: jax/tests/multibackend_test.py
imports: from functools import partial
  from absl.testing import absltest
  import numpy
  import numpy.random
  from unittest import SkipTest
  import jax
  from jax._src import test_util
  from jax import numpy
  from jax import config
label_desc: Use image node_id 3 for calling the MultiBackendTest obj's underlying member method code with example usage: obj.testMultiBackendNestedJitConflict(ordering) and returns: unknown, jnp