def METHOD_NAME(self, xp, dtype):
    backend = 'scipy' if xp is np else cp_fft
    with scipy_fft.set_backend(backend):
        fft_func = getattr(scipy_fft, self.function)
        return self._run_transform(fft_func, xp, dtype)