Closed dsyme closed 3 years ago
C# Complex.cs https://github.com/microsoft/referencesource/blob/master/System.Numerics/System/Numerics/Complex.cs
THe C++ std::complex https://en.cppreference.com/w/cpp/numeric/complex
They seem to have exactly the same memory layout, I'm not sure what's up.
I have added fairly complete support for complex numbers in the TorchSharp bindings. There was really no need to deal with the std::complex type in C++.
Torch has support for ComplexFloat and ComplexDouble tensors.
I took a look at lighting this up for ComplexDouble using System.Numerics.Complex as the .NET in-memory interchange type. However I got a crash and disabled it - it should have "just worked" if the memory layouts are compatible - I'll double check what's going on.
The test
CreateComplexDoubleTensorFromDataCheckStrides
is commented out