Commit 076b953c by Ivan Smirnov

Restore dtype equivalence sanity check

parent 8f2f7cd6
...@@ -342,11 +342,9 @@ struct npy_format_descriptor<T, typename std::enable_if<is_pod_struct<T>::value> ...@@ -342,11 +342,9 @@ struct npy_format_descriptor<T, typename std::enable_if<is_pod_struct<T>::value>
// Sanity check: verify that NumPy properly parses our buffer format string // Sanity check: verify that NumPy properly parses our buffer format string
auto arr = array(buffer_info(nullptr, sizeof(T), format(), 1, { 0 }, { sizeof(T) })); auto arr = array(buffer_info(nullptr, sizeof(T), format(), 1, { 0 }, { sizeof(T) }));
auto dtype = (object) arr.attr("dtype"); auto fixed_dtype = array::strip_padding_fields(object(dtype_(), true));
auto fixed_dtype = dtype; if (!api.PyArray_EquivTypes_(dtype_(), fixed_dtype.ptr()))
// auto fixed_dtype = array::strip_padding_fields(object(dtype_(), true)); pybind11_fail("NumPy: invalid buffer descriptor!");
// if (!api.PyArray_EquivTypes_(dtype_(), fixed_dtype.ptr()))
// pybind11_fail("NumPy: invalid buffer descriptor!");
} }
private: private:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment