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] Replace internal representation of Python-scope ti.Matrix with numpy arrays #7559

Merged
merged 7 commits into from
Mar 17, 2023

Conversation

strongoier
Copy link
Contributor

@strongoier strongoier commented Mar 14, 2023

Issue: #7447

Brief Summary

This PR corresponds to step 3 of #7447. The code paths in matrix.py and ops.py have been significantly simplified:

  • The Matrix class, which is for Python scope, now only contains two cases, numpy arrays for values and nested lists for host access of SNode/Ndarray. Redundant internal functions have been removed. dt now has effects because numpy arrays have types.
  • No more element_wise_xxx, uniform_matrix_inputs and @unary, @binary decorators. The full dispatching logic for ops is in unique entrances _unary_operation/_binary_operation.

Note that Python-scope matrix slicing is temporarily disabled in this PR because the feature itself is incomplete - only read is supported. It can be re-supported in a better way in the future. Taichi-scope matrix slicing still works properly.

@netlify
Copy link

netlify bot commented Mar 14, 2023

Deploy Preview for docsite-preview ready!

Name Link
🔨 Latest commit f07923a
🔍 Latest deploy log https://app.netlify.com/sites/docsite-preview/deploys/641171e068846f00076ea3c3
😎 Deploy Preview https://deploy-preview-7559--docsite-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@taichi-gardener taichi-gardener added this to In progress in Lang Features & Python Mar 14, 2023
@strongoier strongoier marked this pull request as ready for review March 15, 2023 07:19
@ailzhang ailzhang merged commit ed3eed4 into taichi-dev:master Mar 17, 2023
Lang Features & Python automation moved this from In progress to Done Mar 17, 2023
@strongoier strongoier deleted the taichi-ops-2 branch March 17, 2023 12:36
quadpixels pushed a commit to quadpixels/taichi that referenced this pull request May 13, 2023
… numpy arrays (taichi-dev#7559)

Issue: taichi-dev#7447

### Brief Summary

This PR corresponds to step 3 of taichi-dev#7447. The code paths in `matrix.py`
and `ops.py` have been significantly simplified:
- The `Matrix` class, which is for Python scope, now only contains two
cases, numpy arrays for values and nested lists for host access of
`SNode`/`Ndarray`. Redundant internal functions have been removed. `dt`
now has effects because numpy arrays have types.
- No more `element_wise_xxx`, `uniform_matrix_inputs` and `@unary,
@binary` decorators. The full dispatching logic for ops is in unique
entrances `_unary_operation/_binary_operation`.

Note that Python-scope matrix slicing is temporarily disabled in this PR
because the feature itself is incomplete - only read is supported. It
can be re-supported in a better way in the future. Taichi-scope matrix
slicing still works properly.

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants