Decorator for implementing partial application.

    This must decorate the ``transform`` and ``grad`` methods of basis objects
    if the ``slice_init`` decorator was used.

def slice_transform(func, self, X, *vargs, **kwargs):
    """
    Decorator for implementing partial application.

    This must decorate the ``transform`` and ``grad`` methods of basis objects
    if the ``slice_init`` decorator was used.
    """
    X = X if self.apply_ind is None else X[:, self.apply_ind]
    return func(self, X, *vargs, **kwargs)