mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-29 08:32:02 +00:00
Revert "Template array constructor (#582)"
This reverts commit bee8827a98
.
This commit is contained in:
parent
11a337f16f
commit
329d983392
@ -337,9 +337,8 @@ public:
|
|||||||
|
|
||||||
array() : array(0, static_cast<const double *>(nullptr)) {}
|
array() : array(0, static_cast<const double *>(nullptr)) {}
|
||||||
|
|
||||||
template <typename Shape, typename Strides>
|
array(const pybind11::dtype &dt, const std::vector<size_t> &shape,
|
||||||
array(const pybind11::dtype &dt, const Shape &shape,
|
const std::vector<size_t> &strides, const void *ptr = nullptr,
|
||||||
const Strides &strides, const void *ptr = nullptr,
|
|
||||||
handle base = handle()) {
|
handle base = handle()) {
|
||||||
auto& api = detail::npy_api::get();
|
auto& api = detail::npy_api::get();
|
||||||
auto ndim = shape.size();
|
auto ndim = shape.size();
|
||||||
@ -537,7 +536,7 @@ protected:
|
|||||||
throw std::runtime_error("array is not writeable");
|
throw std::runtime_error("array is not writeable");
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename Shape> static std::vector<size_t> default_strides(const Shape& shape, size_t itemsize) {
|
static std::vector<size_t> default_strides(const std::vector<size_t>& shape, size_t itemsize) {
|
||||||
auto ndim = shape.size();
|
auto ndim = shape.size();
|
||||||
std::vector<size_t> strides(ndim);
|
std::vector<size_t> strides(ndim);
|
||||||
if (ndim) {
|
if (ndim) {
|
||||||
|
Loading…
Reference in New Issue
Block a user