class_docstr: Tests for Numpy indexing translation rules.
class_docstr_tok: ["Tests","for","Numpy","indexing","translation","rules","."]
code: def testIndexingEmptyDimension(self):
      # Issue 2671: XLA error when indexing into dimension of size 0
      x = jnp.ones((2, 0))
      # The following work, even on axis 1 of size 0
      _ = x[0, :] + x[0, None] + x[0, 1:] + x[0, 1:3:2]
  
      with self.assertRaisesRegex(
          IndexError,
          "index .* is out of bounds for axis .* with size 0",
      ):
          _ = onp.ones((2, 0))[0, 0]  # The numpy error
      with self.assertRaisesRegex(
          IndexError, "index is out of bounds for axis .* with size 0"
      ):
          _ = x[0, 0]  # JAX indexing
      with self.assertRaisesRegex(
          IndexError, "index is out of bounds for axis .* with size 0"
      ):
          npe.jit(lambda i: x[0, i])(0)
  
imports: import collections
  import enum
  from functools import partial
  import itertools
  import unittest
  from absl.testing import absltest
  from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v2
  import trax.tf_numpy.extensions
  import trax.tf_numpy.numpy
  from trax.tf_numpy.jax_tests.config import config
  import trax.tf_numpy.jax_tests.test_util
label_desc: Use image node_id 16 for calling the IndexingTest obj's underlying member method code with example usage: obj.testIndexingEmptyDimension() without return types