★ wanayoo — archive 1999 https://github.com/xtensor-stack/xtensor-python/issues/129Nouvelle recherche | Portail wanayoo
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

dtype gets implicitly converted, and buffer is copied #129

Open
wolfv opened this issue Dec 14, 2017 · 1 comment
Open

dtype gets implicitly converted, and buffer is copied #129

wolfv opened this issue Dec 14, 2017 · 1 comment

Comments

@wolfv
Copy link
Member

@wolfv wolfv commented Dec 14, 2017

When we have a function taking a pyarray but pass in a numpy array of integers, the numpy array is implicitly converted to a pyarray of doubles (but this creates a copy of the buffer).

We should think about emitting a warning in this case, or make the warning user modifiable.
Or at least clearly document it.

@wolfv wolfv changed the title dtype get dtype gets implicitly converted, and buffer is copied Dec 14, 2017
@wolfv
Copy link
Member Author

@wolfv wolfv commented Jun 21, 2018

Actually in pybind11 there is a compile-time option like so:

void f(py::array_t<double, py::array::c_style | py::array::forcecast> array);

To signify if that array should be casted or not. Maybe we could use that, or something similar?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.