-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Lang] [refactor] Deprecate "as_vector=True" in Matrix.to_numpy/to_torch #1046
Merged
Merged
Changes from 23 commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
9ea24d3
[skip ci] first step
archibate 53ba74c
[skip ci] sep
archibate aad89f8
[skip ci] enforce code format
taichi-gardener 37ada2b
[skip ci] move methods
archibate 856d870
[skip ci] fix as_vector
archibate b2e43b2
[skip ci] deprecate as_vector
archibate b3c2edd
[skip ci] fix test
archibate d1acb5a
[skip ci] update examples
archibate b5c0c5f
[skip ci] empty_copy
archibate accfbeb
[skip ci] enforce code format
taichi-gardener 9d29718
[skip ci] Merge branch 'master' into vector
archibate 0c1602a
[skip travis] [skip appveyor] the perfect solution
archibate b918063
[skip ci] Merge branch 'master' into vector
archibate ebdb474
[skip travis] [skip appveyor] apply @yuanming-hu's suggestion
archibate f4ef822
Merge branch 'master' into vector
archibate d700745
[skip ci] update doc
archibate 092bd44
[skip ci] pvc #1051
archibate a6a6b56
Merge branch 'master' into vector
archibate d2f0e8d
[skip ci] use keep_dims
archibate 4677ab0
[skip ci] fix test
archibate deba49a
[skip ci] really fix
archibate 1306a0c
[skip ci] fix again!
archibate 0832e8d
[skip ci] did fix linalg
archibate cf31691
Merge branch 'master' into vector
archibate 85bcaca
[skip ci] app2
archibate e014073
[skip ci] fix test
archibate 4171b77
Merge branch 'master' into vector
archibate e1ddf6b
[skip ci] enforce code format
taichi-gardener ea4297f
[skip ci] fix matrix n/m order
archibate 878f0fd
[skip ci] Merge branch 'vector' of github.com:archibate/taichi into v…
archibate 40164ef
Merge branch 'master' into vector
archibate 3cb89bc
[skip travis] apply update test
archibate e488390
[skip ci] Merge branch 'master' into vector
archibate 5cd750a
hack Vector attrs
archibate acabb91
[skip ci] enforce code format
taichi-gardener 8682a95
[skip ci] update doc
archibate File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's skip
self.m
as well if it value is1
.len(dim_ext)=
0
for1x1
matrices1
fornx1
or1xn
matrices (n != 1
)2
fornxm
matrices (n, m != 1
)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then I should change matrix_to_ext_arr to treat the useless
1x1
matrices?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it seems that we need a
keep_dims
parameter inmatrix_to_ext_arr
as well.Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Special treating 1x1 mats sounds unreasonable to me..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few people would use 1x1 matrices anyway. Let's just make the behavior consistent: dimensionality of size
1
should be skipped.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wdym? Do we consider 1x1 mat as 1D vector?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean, if the matrix is
1x1
, then the numpy array, whenkeep_dims=False
, should have the same shape as the matrix shape, instead of the matrix shape extended by(1, 1)
.