File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -337,8 +337,9 @@ class array : public buffer {
337
337
338
338
array () : array(0 , static_cast <const double *>(nullptr )) {}
339
339
340
- array (const pybind11::dtype &dt, const std::vector<size_t > &shape,
341
- const std::vector<size_t > &strides, const void *ptr = nullptr ,
340
+ template <typename Shape, typename Strides>
341
+ array (const pybind11::dtype &dt, const Shape &shape,
342
+ const Strides &strides, const void *ptr = nullptr ,
342
343
handle base = handle()) {
343
344
auto & api = detail::npy_api::get ();
344
345
auto ndim = shape.size ();
@@ -536,7 +537,7 @@ class array : public buffer {
536
537
throw std::runtime_error (" array is not writeable" );
537
538
}
538
539
539
- static std::vector<size_t > default_strides (const std::vector< size_t > & shape, size_t itemsize) {
540
+ template < typename Shape> static std::vector<size_t > default_strides (const Shape & shape, size_t itemsize) {
540
541
auto ndim = shape.size ();
541
542
std::vector<size_t > strides (ndim);
542
543
if (ndim) {
You can’t perform that action at this time.
0 commit comments