def test_eliminate_expand_dims(self):
        """
        Input graph:
            data -> constexpr_affine_dequantize -> expand_dims

        Output graph:
            new_data -> constexpr_affine_dequantize

        where new_data is the value after applying expand_dims to data
        """
        quantized_data = np.random.randint(0, 256, (2, 3, 4)).astype(np.int8)

        @mb.program(input_specs=[], opset_version=ct.target.iOS16)
        def prog():
            res = mb.constexpr_affine_dequantize(
                quantized_data=quantized_data,
                axis=0,
                scale=8.9,
                zero_point=np.int8(34),
            )
            return mb.expand_dims(x=res, axes=(0, 2, 4))

        apply_pass_and_basic_check(prog, "common::merge_affine_dequantize_with_consecutive_ops")
        assert get_op_types_in_program(prog) == ["constexpr_affine_dequantize"]

        new_op = prog.find_ops(op_type="constexpr_affine_dequantize", exactly_one=True)[0]
        expected_quantized_data = np.expand_dims(quantized_data, axis=(0, 2, 4))
        np.testing.assert_array_equal(new_op.quantized_data.val, expected_quantized_data)

        Input graph:
            data -> constexpr_affine_dequantize -> expand_dims

        Output graph:
            new_data -> constexpr_affine_dequantize

        where new_data is the value after applying expand_dims to data
        
coremltools/converters/mil/mil/passes/tests/test_quantization_passes.py