def test_reorder_multiple_usages(self, input_shape: Tuple[int, ...], has_bias: bool):
        """The scaled weight is used by multiple ops."""

        @mb.program(
            input_specs=[mb.TensorSpec(shape=input_shape, dtype=types.fp16)],
            opset_version=ct.target.iOS18,
        )
        def prog(x):
            scaled_weight = self._get_lut_pcs_weight((2, input_shape[-1]))
            bias = np.array([20, 50], dtype=np.float16) if has_bias else None
            linear_output = mb.linear(x=x, weight=scaled_weight, bias=bias)
            matmul_output = mb.matmul(x=x, y=scaled_weight, transpose_x=False, transpose_y=True)
            return mb.add(x=linear_output, y=matmul_output)

        prev_prog, _, block = apply_pass_and_basic_check(
            prog, "common::reorder_lut_per_channel_scale", skip_essential_scope_check=True
        )
        assert get_op_types_in_program(prev_prog) == [
            "constexpr_lut_to_dense",
            "constexpr_blockwise_shift_scale",
            "linear",
            "matmul",
            "add",
        ]
        assert get_op_types_in_program(prog) == [
            "constexpr_lut_to_dense",
            "linear",
            "mul",
            "matmul",
            "mul",
            "add",
        ]
        self._verify_numerical(prev_prog, prog, block, input_shape)
The scaled weight is used by multiple ops.
coremltools/converters/mil/mil/passes/tests/test_quantization_passes.py