def inverse_transform(self, y):
        """Revert the transformation of transform.

        Args:
            y: np.ndarray
                Transformed numpy array.

        Returns:
            np.ndarray
                If the transformer was fit to a 1D numpy array,
                and a 2D numpy array with a singleton second dimension
                is passed, it will be squeezed back to 1D. Otherwise, it
                will eb left untouched.
        """
        sklearn.base.check_is_fitted(self)
        xp, _ = sklearn.utils._array_api.get_namespace(y)
        if self.ndim_ == 1 and y.ndim == 2:
            return xp.squeeze(y, axis=1)
        return y
Revert the transformation of transform.

        Args:
            y: np.ndarray
                Transformed numpy array.

        Returns:
            np.ndarray
                If the transformer was fit to a 1D numpy array,
                and a 2D numpy array with a singleton second dimension
                is passed, it will be squeezed back to 1D. Otherwise, it
                will eb left untouched.
        
keras/src/wrappers/utils.py