def set_global(self, op_config: OpCompressorConfig):
        """
        Sets the global config that would be applied to all constant ops.

        .. code-block:: python

            from coremltools.optimize.coreml import OpPalettizerConfig, OptimizationConfig

            config = OptimizationConfig()
            global_config = OpPalettizerConfig(mode="kmeans", nbits=8)
            config.set_global(global_config)

        Parameters
        ----------

        op_config: OpCompressorConfig
            Config to be applied globally to all supported ops.
        """
        self._check_op_config_type(op_config)
        self.global_config = op_config

        Sets the global config that would be applied to all constant ops.

        .. code-block:: python

            from coremltools.optimize.coreml import OpPalettizerConfig, OptimizationConfig

            config = OptimizationConfig()
            global_config = OpPalettizerConfig(mode="kmeans", nbits=8)
            config.set_global(global_config)

        Parameters
        ----------

        op_config: OpCompressorConfig
            Config to be applied globally to all supported ops.
        
coremltools/optimize/coreml/_config.py