Hi,
You will have to create a new Function indeed. But your forward and backward methods can simply call into scipy’s fft implementation. Also keep in mind that moving datas from the cpu to the gpu is not free and can impact performances if you do it a lot.