Skip to content

Commit 329d983

Browse files
dean0x7dwjakob
authored andcommitted
Revert "Template array constructor (#582)"
This reverts commit bee8827.
1 parent 11a337f commit 329d983

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

include/pybind11/numpy.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -337,9 +337,8 @@ class array : public buffer {
337337

338338
array() : array(0, static_cast<const double *>(nullptr)) {}
339339

340-
template <typename Shape, typename Strides>
341-
array(const pybind11::dtype &dt, const Shape &shape,
342-
const Strides &strides, const void *ptr = nullptr,
340+
array(const pybind11::dtype &dt, const std::vector<size_t> &shape,
341+
const std::vector<size_t> &strides, const void *ptr = nullptr,
343342
handle base = handle()) {
344343
auto& api = detail::npy_api::get();
345344
auto ndim = shape.size();
@@ -537,7 +536,7 @@ class array : public buffer {
537536
throw std::runtime_error("array is not writeable");
538537
}
539538

540-
template <typename Shape> static std::vector<size_t> default_strides(const Shape& shape, size_t itemsize) {
539+
static std::vector<size_t> default_strides(const std::vector<size_t>& shape, size_t itemsize) {
541540
auto ndim = shape.size();
542541
std::vector<size_t> strides(ndim);
543542
if (ndim) {

0 commit comments

Comments
 (0)