If you don’t mind me asking, what does it mean to have a complex cost function (i.e. how do you “minimize”)?
One obvious way could be to feed the real and imaginary into the network separately, it would seem PyTorch still needs a bit before supporting complex for everything. Matmul should work with the preview nightly but not Linear, so you could define your own linear if you want.
Best regards
Thomas