code: def lut_config_generator():
      np.random.seed(1999)
      for lut_dtype in [np.float32]:  # [np.uint8, np.int8]:
          # float16 already covered under backends parameterization
          # Not possible to write 8-bit tests since no other op consumes uint8/int8 tensors
          for nbits in [1, 2, 4, 6, 8]:
              lut_size = 2**nbits
              if lut_dtype == np.uint8:
                  lut = np.random.randint(
                      low=255, size=lut_size, dtype=np.uint8
                  )
              elif lut_dtype == np.int8:
                  lut = np.random.randint(
                      low=-128, high=127, size=lut_size, dtype=np.int8
                  )
              else:
                  lut = np.random.rand(lut_size).astype(lut_dtype)
              for output_rank in range(1, 6):
                  output_shape = np.random.randint(
                      low=2, high=5, size=output_rank
                  )
  
                  indices = np.random.randint(
                      low=0,
                      high=2**nbits,
                      size=output_shape,
                      dtype=np.uint8,
                  )
                  indices_bitarray = np.unpackbits(
                      indices, bitorder="little"
                  ).reshape(-1, 8)
                  packed_indices = np.packbits(
                      indices_bitarray[:, :nbits], bitorder="little"
                  )
  
                  assert packed_indices.size == np.ceil(
                      nbits * np.prod(output_shape) / 8
                  ).astype(np.int32)
                  params = {
                      "indices": packed_indices,
                      "shape": output_shape,
                      "lut": lut,
                  }
                  yield params
  
imports: import itertools
  import numpy
  import pytest
  from coremltools.converters.mil import testing_reqs
  from coremltools.converters.mil.mil import Builder
  from coremltools.converters.mil.mil import types
  from coremltools.converters.mil.mil.ops.defs.iOS16 import constexpr_ops
  from coremltools.converters.mil.mil.ops.tests.iOS16 import backends
  from coremltools.converters.mil.mil.ops.tests.testing_utils import run_compare_builder
  from coremltools.converters.mil.testing_utils import get_op_types_in_program, ssa_fn
label_desc: Use image node_id 3 for calling the TestConstexprLutToDense obj's underlying member method code with example usage: obj.lut_config_generator() without return types