Closed
Description
Issue description
Function accepting pybind11::buffer
reports different underlying type when provided with (at least at the first glance) numpy arrays. I can only guess it may be more related to numpy which somehow fails to comply with python's buffer protocol in some cases. But I want to make sure that pybind11 doesn't do anything that could affect this.
Reproducible example code
a = np.array([1, 2], dtype=np.longlong)
b = np.array([1, 2], dtype=np.int64)
some_native_function_accepting_py11buffer(a)
some_native_function_accepting_py11buffer(b)
a reports to have q
format while b l
which is wrong in b case. Numpy claims dtype as int64 for both of them.
Full repro attached, just issue run.sh
(and make sure that pybind11 is present in the same dir as run.sh
).
Metadata
Metadata
Assignees
Labels
No labels