complex functions that already support autograd - Pytorch
I am using this customized function to reshape my tensors in the customized loss function.
def reshape_fortran(x, shape):
if len(x.shape) &gt; 0:
    x = x.permute(*reversed(range(len(x.shape))))
return x.reshape(*reversed(shape)).permute(*reversed(range(len(shape))))

Though, I receive this error:
RuntimeError: _unsafe_view does not support automatic differentiation for outputs with complex dtype. 
for reshape_fortran output.
Do you know what might be the problem? which function is not supported in Pytorch autograd for complex numbers?

Complex Autograd was in Beta as of version 1.8, but is now stable and should fully support such operations as of 1.9.
