When I do torch.norm(tensor) where tensor is vector shaped with complex values I get the following error:
ValueError: dtype argument is not supported in frobenius norm
Is there a way to take the 2-norm of such a tensor?
The short answer is that you can implement your own correct
complex norm (see below).
Yes, I think this is the core issue.
On 1.6.0 (current stable), I can take the norm of a complex vector,
but the result isn’t correct. (I haven’t tried 1.7.) Pytorch is using the
complex square, rather than x * x.conj().
This illustrates the issue, and shows how you can implement your
own correct version: