Skip to content
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] MatrixType bug fix: Allow indexing a matrix r-value #6291

Merged
merged 1 commit into from
Oct 12, 2022

Conversation

strongoier
Copy link
Contributor

Issue: #5819

Brief Summary

It is possible that a local matrix is indexed without being assigned to a variable:

@ti.kernel
def local_vector_read(i: ti.i32) -> ti.i32:
    return ti.Vector([0, 1, 2])[i]

In this case we need to turn it from an r-value to an l-value so that we can successfully construct the index.

@netlify
Copy link

netlify bot commented Oct 11, 2022

Deploy Preview for docsite-preview canceled.

Name Link
🔨 Latest commit a1374dc
🔍 Latest deploy log https://app.netlify.com/sites/docsite-preview/deploys/634526fc7be7e0000af3b86a

@strongoier strongoier added the full-ci Run complete set of CI tests label Oct 11, 2022
@strongoier strongoier changed the title [Lang] Fix local matrix index without assign when real_matrix=True [lang] MatrixType bug fix: Allow indexing a matrix literal Oct 12, 2022
@strongoier strongoier changed the title [lang] MatrixType bug fix: Allow indexing a matrix literal [lang] MatrixType bug fix: Allow indexing a matrix r-value Oct 12, 2022
@strongoier strongoier merged commit 7efbbce into taichi-dev:master Oct 12, 2022
@strongoier strongoier deleted the mat-10 branch October 12, 2022 05:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
full-ci Run complete set of CI tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants