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] Add @python_scope decorator for selected MatrixNdarray/VectorNdarray methods #5844

Merged
merged 1 commit into from
Aug 24, 2022

Conversation

jim19930609
Copy link
Contributor

Related issue = #5819

@netlify
Copy link

netlify bot commented Aug 23, 2022

Deploy Preview for docsite-preview ready!

Name Link
🔨 Latest commit 2050072
🔍 Latest deploy log https://app.netlify.com/sites/docsite-preview/deploys/6304827a191bed00095315b9
😎 Deploy Preview https://deploy-preview-5844--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.

@AD1024
Copy link
Contributor

AD1024 commented Aug 23, 2022

Looks good. Thanks for adding these!
One question: are these methods supposed to be called by users? Looks like they are for internal uses.
Another side note (correct me if I'm wrong):
if they are not for users, probably some could be omitted since they are only called by methods that are callable from Python scope. e.g.

@python_scope
def to_numpy(self):
return self._ndarray_to_numpy()

@jim19930609
Copy link
Contributor Author

Looks good. Thanks for adding these! One question: are these methods supposed to be called by users? Looks like they are for internal uses. Another side note (correct me if I'm wrong): if they are not for users, probably some could be omitted since they are only called by methods that are callable from Python scope. e.g.

@python_scope
def to_numpy(self):
return self._ndarray_to_numpy()

Yes, I do agree some of these methods are not intended to be called by the users thus does not matter whether it has explicit "ti_scope" or "python_scope" decorators. However, since the "ti_scope" and "python_scope" is essentially exclusive at least for now, marking the decorators explicitly improves the readability a lot~

@jim19930609 jim19930609 merged commit 4b6eccb into taichi-dev:master Aug 24, 2022
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