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] Support matrix initialization with a list of vectors #811
Conversation
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.
Thanks for implementing this! I think this is a very useful feature. Two thoughts:
- Maybe we can use a syntax like
ti.Matrix(rows=[a, b, c])/ti.Matrix(cols=[a, b, c])
so that the matrix composition is clearer? I was unsure if the vectors are rows or columns at the first glance. This also preventsti.Matrix(...)
from being too smart. - Let's briefly document this fancy matrix creation approach in https://github.com/taichi-dev/taichi/blob/master/docs/linalg.rst#matrices so that users know what you have done here :-)
I think the rows/cols is a good idea. Should we make it mandatory? And should it also be used for list of list style initialization? |
Yeah I think we can make it mandatory for making matrices from vectors. For list of list, let's keep the old style, since changing that might break some code.
|
919bfdb
to
95c55bc
Compare
Sorry about the confusing commits! To remove them: git checkout master
git reset --hard origin/master
git pull --set-upstream origin master
git reset --hard origin/master
git checkout vector_to_matrix
git rebase -i master Then you'll see:
Please delete those lines that are not related to this PR, then save and quit ( |
That was my fault - when merging #785 I accidentally chose To prevent this from happening again, I have disabled |
oh no. lots and lots of test failing, not just test_ad_atomic
|
oh wait I see why its failing. for some reason the path to the test.py is wrong. but not for all tests |
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.
Thank you so much! Now it LGTM except for a few minor nits.
Thanks for improving the documentation of both linalg
(which should more or less be renamed matrix
now...) and vector
! This feature will be very useful.
bug fixed. all test seem to be running fine. I just had to delete the pycache in the test directory. I change the local repo name last week and I guess the cached files remembered the old name. |
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.
Everything LGTM! Thanks!
Related issue = #810
[Click here for the format server]