-
-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support complex64 tensor - real scalar operations (like numpy does) (#…
…629) It is always possible to operate on a Complex64 tensor with a real scalar without loss of precision, so we allow it without explicit type conversion. This is supported by numpy, and makes complex tensor arithmetic more convenient to use (by avoiding having to explicitly make many obvious conversions to complex). As an example, assuming `t` is a Tensor[Complex64], this let's you write expressions such as: ``` (complex(1.0 / sqrt(2.0)) *. t -. complex(1.0)) /. complex(t.size.float) ``` as follows: ``` ((1.0 / sqrt(2.0)) *. t -. 1.0) /. t.size ``` which is much more easier to understand while being equally safe.
- Loading branch information
1 parent
86c1342
commit d7b1fff
Showing
2 changed files
with
146 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters