def quantize(self, x):
        """
        Quantize ``x`` using pre-computed quantization parameters.
        """
        if self.ready():
            return quantize(x, self.scale, self.zero_point, self.max_q, self._enable_normal_float)
        return x

        Quantize ``x`` using pre-computed quantization parameters.
        
coremltools/optimize/torch/layerwise_compression/_quant.py