def test_builder_eval_scalar_lut(self):
        """
        indices_mask<uint1, [4, 6]> =
            [[1, 1, 0, 0, 0, 0],
            [1, 1, 0, 0, 0, 1],
            [0, 1, 1, 0, 1, 0],
            [0, 0, 0, 1, 0, 0]]
        indices_nonzero_data<uint1, [9]> = [0, 1, 1, 0, 1, 1, 0, 0, 1]
        lut<fp16, [1, 1, 2, 1]> = [2.0, 3.0]

        The output mask is the same as input indices_mask.
        The output sparse tensor in the dense layout is:
             2.0  3.0
             3.0  2.0                3.0
                  3.0  2.0      2.0
                            3.0
        So the output nonzero_data is [2.0, 3.0, 3.0, 2.0, 3.0, 3.0, 2.0, 2.0, 3.0].
        """

        @mb.program(input_specs=[], opset_version=_IOS18_TARGET)
        def prog():
            return mb.constexpr_lut_to_sparse(
                indices_mask=np.array(
                    [[1, 1, 0, 0, 0, 0], [1, 1, 0, 0, 0, 1], [0, 1, 1, 0, 1, 0], [0, 0, 0, 1, 0, 0]]
                ).astype(types.np_uint1_dtype),
                indices_nonzero_data=np.array([0, 1, 1, 0, 1, 1, 0, 0, 1]).astype(
                    types.np_uint1_dtype
                ),
                lut=np.array([2.0, 3.0]).reshape((1, 1, 2, 1)),
            )

        constexpr_lut_to_sparse_op = prog.functions["main"].find_ops(
            op_type="constexpr_lut_to_sparse"
        )[0]
        expected_output_mask = np.array(
            [[1, 1, 0, 0, 0, 0], [1, 1, 0, 0, 0, 1], [0, 1, 1, 0, 1, 0], [0, 0, 0, 1, 0, 0]]
        )
        expected_output_nonzero_data = np.array([2.0, 3.0, 3.0, 2.0, 3.0, 3.0, 2.0, 2.0, 3.0])
        output_mask, output_nonzero_data = constexpr_lut_to_sparse_op.outputs[
            0
        ].op.materialized_val_inference()
        np.testing.assert_allclose(output_mask, expected_output_mask)
        np.testing.assert_allclose(output_nonzero_data, expected_output_nonzero_data)

        indices_mask<uint1, [4, 6]> =
            [[1, 1, 0, 0, 0, 0],
            [1, 1, 0, 0, 0, 1],
            [0, 1, 1, 0, 1, 0],
            [0, 0, 0, 1, 0, 0]]
        indices_nonzero_data<uint1, [9]> = [0, 1, 1, 0, 1, 1, 0, 0, 1]
        lut<fp16, [1, 1, 2, 1]> = [2.0, 3.0]

        The output mask is the same as input indices_mask.
        The output sparse tensor in the dense layout is:
             2.0  3.0
             3.0  2.0                3.0
                  3.0  2.0      2.0
                            3.0
        So the output nonzero_data is [2.0, 3.0, 3.0, 2.0, 3.0, 3.0, 2.0, 2.0, 3.0].
        
coremltools/converters/mil/mil/ops/tests/iOS18/test_compression.py