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

[bug] Fix extraction of field with offset to external array #7945

Merged
merged 26 commits into from
May 11, 2023

Conversation

dream189free
Copy link
Contributor

@dream189free dream189free commented May 6, 2023

Issue: #7775

Brief Summary

🤖 Generated by Copilot at 44074b9

This pull request adds support for offset tensors in Taichi, which are tensors with non-zero lower bounds for their index domains. It updates the test_offset.py file to add more tests, the tensor_to_ext_arr function to handle offset copying, and the SNode class to expose the offset attribute to Python.

Walkthrough

🤖 Generated by Copilot at 44074b9

  • Add offset attribute to SNode class and expose it to Python interface (link)
  • Modify tensor_to_ext_arr function to account for offset attribute when copying data to external array (link)
  • Add test cases to check the correctness of offset tensor's data and conversion methods (link, link)

@netlify
Copy link

netlify bot commented May 6, 2023

Deploy Preview for docsite-preview ready!

Name Link
🔨 Latest commit 2b05838
🔍 Latest deploy log https://app.netlify.com/sites/docsite-preview/deploys/645ba4743dd46d00087d3c08
😎 Deploy Preview https://deploy-preview-7945--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.

@dream189free dream189free requested a review from ailzhang May 6, 2023 11:55
@dream189free dream189free requested a review from jim19930609 May 6, 2023 11:56
Copy link
Contributor

@jim19930609 jim19930609 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Copy link
Contributor

@ailzhang ailzhang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: btw there're many other built-in kernels that may require a similar fix ;)

Copy link
Contributor

@jim19930609 jim19930609 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Copy link
Contributor

@ailzhang ailzhang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: can we add a few more tests to make sure every touched kernel is tested? ;) Thanks!

@dream189free dream189free merged commit a0c50b8 into taichi-dev:master May 11, 2023
quadpixels pushed a commit to quadpixels/taichi that referenced this pull request May 13, 2023
…ev#7945)

Issue: taichi-dev#7775

### Brief Summary

<!--
copilot:summary
-->
### <samp>🤖 Generated by Copilot at 44074b9</samp>

This pull request adds support for offset tensors in Taichi, which are
tensors with non-zero lower bounds for their index domains. It updates
the `test_offset.py` file to add more tests, the `tensor_to_ext_arr`
function to handle offset copying, and the `SNode` class to expose the
offset attribute to Python.

### Walkthrough

<!--
copilot:walkthrough
-->
### <samp>🤖 Generated by Copilot at 44074b9</samp>

* Add offset attribute to SNode class and expose it to Python interface
([link](https://github.com/taichi-dev/taichi/pull/7945/files?diff=unified&w=0#diff-af631a0c71978fe591e17005f01f7c06bc30ae36c65df306bbb3b08ade770167R471))
* Modify tensor_to_ext_arr function to account for offset attribute when
copying data to external array
([link](https://github.com/taichi-dev/taichi/pull/7945/files?diff=unified&w=0#diff-09cd7b8194d05b7454b512d74fc5b442aed2319dcb763e182288b55753ce6feeL42-R48))
* Add test cases to check the correctness of offset tensor's data and
conversion methods
([link](https://github.com/taichi-dev/taichi/pull/7945/files?diff=unified&w=0#diff-520d9ca52eed08ca617ef520e95d0d1778fb1943b9652f7a388b63abca00ddd1R148-R162),
[link](https://github.com/taichi-dev/taichi/pull/7945/files?diff=unified&w=0#diff-520d9ca52eed08ca617ef520e95d0d1778fb1943b9652f7a388b63abca00ddd1R6))

---------

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants