Skip to content

Distinguish scalars and tensors #56

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

Closed
ev-br opened this issue Feb 16, 2023 · 1 comment
Closed

Distinguish scalars and tensors #56

ev-br opened this issue Feb 16, 2023 · 1 comment

Comments

@ev-br
Copy link
Collaborator

ev-br commented Feb 16, 2023

Over at #51 (comment), @lezcano observes that

we don't want to wrap scalars into tensors if we don't need to. Scalars are easier to treat in a compiler than tensors, and often get extra optimisations (no memory allocations, no synchronisations when accessed if we are working on CUDA, you can specialise on them...)

Note that this applies in general, so we should be mindful about this going all across.

So far the approach is quite the opposite: convert everything so scalars become 0-dim tensors, and proceed with tensors. Special-casing scalars would make wrappers heavier so if this is something we are going to do, it needs to be done across the codebase indeed.

@ev-br
Copy link
Collaborator Author

ev-br commented Jul 17, 2023

This is now at least consistent: we implement NEP51 in (a whitelisted subset of) binary ufuncs, the rest is probably low-prio.

@ev-br ev-br closed this as completed Jul 17, 2023
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

No branches or pull requests

1 participant