-
-
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.
Relax some shape checks for rank-1 tensors (#625)
* Relax some shape checks for rank-1 tensors Consider that rank-1 tensors are "shapeless" and can fit both into [1, N] and [N, 1] tensors, for example. This greatly reduces the need to use .reshape after converting a seq or array into a tensor in assignments, and reduces errors that happen at runtime for code that is conceptually correct. For example, with this change this will work: ``` var t = eye(3, 3) t[_,0] = [1, 2, 3].toTensor ``` * allow disabling relaxed rank 1 checks using `-d:RelaxedRankOne=false` --------- Co-authored-by: Vindaar <basti90@gmail.com>
- Loading branch information
1 parent
7f9359b
commit 6a41201
Showing
3 changed files
with
61 additions
and
5 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
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