def get_scale(self):
        """
        Returns a Python float containing the current scale, or 1.0 if scaling is disabled.
        """
        if self._enabled:
            return self._init_scale if self._scale is None else self._scale
        else:
            return 1.0

        Returns a Python float containing the current scale, or 1.0 if scaling is disabled.
        
intel_extension_for_pytorch/cpu/autocast/_grad_scaler.py