def _get_const_op_config(self, op: operation.Operation):
        """
        This utility function retrieves the compression config by an const operation.Operation instance.
        If the const is fed into multiple operations, an error would be thrown if a conflict is detected.
        """
        if not isinstance(op, operation.Operation):
            raise TypeError(f"op must be type of operation.Operation. Got {type(op)}")

        if not (op.op_type == "const" or op.op_type.startswith("constexpr_")):
            raise TypeError(f"op must be of type const or constexpr. Got {op.op_type}")

        if op.name in self.op_name_configs:
            return self.op_name_configs[op.name]

        if op.op_type in self.op_type_configs:
            # We don't allow users to call set_op_type for "const" ops.
            # The users are supposed to use set_global instead
            raise ValueError("const ops cannot be set by the `set_op_type` function. Please use `set_global`")

        # If the constant's output is only connected to the block output, we don't do compression
        # Due to this bug: rdar://108274019 ([Bug] constexpr ops cannot be directly fed to block output)
        child_ops = [child_op for op_output in op.outputs for child_op in op_output.child_ops]
        if len(child_ops) == 0:
            return None

        # If the const is fed into constexpr ops, we follow the chain to get the non-constexpr.
        if all(child_op.op_type.startswith("constexpr_") for child_op in child_ops):
            return self._get_const_op_config(child_ops[0])

        op_configs = [self._get_op_config(op) for op in child_ops]

        for i, config in enumerate(op_configs):
            if config != op_configs[0]:
                raise ValueError(
                    f"compression config conflict detected between ops {child_ops[0]} and {child_ops[i]}. "
                    f"{child_ops[0]} has config {op_configs[0]} while {child_ops[i]} has {config}."
                )
        return op_configs[0]

        This utility function retrieves the compression config by an const operation.Operation instance.
        If the const is fed into multiple operations, an error would be thrown if a conflict is detected.
        
coremltools/optimize/coreml/_config.py