Add support for more mixed Complex-Real operations #643
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Note: This is a DRAFT because I'd like to reduce the number of functions that are needed. At the moment I had to create a lot of versions of each operator, to support all combinations of (Tensor-Tensor / Tensor-Scalar / Scalar-Tensor) x (Real-Real / Real-Complex / Complex-Real).
This change adds support (almost all of) the same mixed Complex-Real operations that nim's complex module support.
This also changes a bit some of the existing mixed ops. In particular, we used to support mixed ops of Complex64 with any kind of number (including integers) but they did not support Complex32 - float32 ops. While being able to mix Complex64 with ints (for example) was nice, it was not consistent with nim's own complex library and also it would have required adding many more operator overloads, so I decided to just be consistent at the cost of a little usability in a small number of cases.