does pytorch support complex numbers?

Viewed 986

Minimum (not) working example


kernel = Conv2d(in_channels=1, out_channels=1, kernel_size=(3, 2))
data = torch.rand(1, 1, 100, 100).type(torch.complex64)
kernel(data)

yields RuntimeError: "unfolded2d_copy" not implemented for 'ComplexDouble' for 64 and 128 bit complex numbers, while for 32 bit, i get RuntimeError: "copy_" not implemented for 'ComplexHalf'.

Am I missing something, or is pytorch missing support for complex numbers??

note: I'm on macbook, using cpu only.

1 Answers

Currently (@ latest stable version - 1.9.0) Pytorch is missing support for such operations on complex tensors (which are a beta feature). See this feature request at Native implementation of convolution for complex numbers

Splitting into convolution on real & image separately, though not ideal, is the way to go for now.

Related